From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B6831BC69 for ; Mon, 16 Jul 2007 18:46:59 +0200 (CEST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6GGkxwA024700 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 16 Jul 2007 18:46:59 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1IATid-0007V5-00; Mon, 16 Jul 2007 17:46:43 +0100 Date: Mon, 16 Jul 2007 17:46:43 +0100 To: skaller Cc: Jon Harrop , caml-list@yquem.inria.fr Subject: Re: [Caml-list] CallCC using fork (and garbage collected processes) Message-ID: <20070716164643.GB26691@furbychan.cocan.org> References: <200707160630.23737.jon@ffconsultancy.com> <1184566043.8152.55.camel@rosella.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1184566043.8152.55.camel@rosella.wigram> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at concorde with ID 469BA103.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; stack:01 pointer:01 setjmp:01 setjmp:01 bounded:01 threads:01 garbage:01 wrote:01 wrote:01 unix:01 stacks:01 stacks:01 caml-list:01 linear:02 assembler:02 On Mon, Jul 16, 2007 at 04:07:23PM +1000, skaller wrote: > A much reduced version of this idea has been tried > in C, swapping the C stack pointer and registers using > setjmp/longjmp and some assembler. It's even easier to use makecontext(3) et al, if you have them. I wrote a C implementation which tries a variety of strategies (makecontext, setjmp, assembly), here: http://annexia.org/freeware/pthrlib > This is, of course, much faster than forking. > > However the C method doesn't work, because Unix uses > linear bounded stacks, and there isn't enough address > space to create enough stacks. This is more of a problem with 32 bit machines. 64 bit machines shouldn't have an issue. Even on a 32 bit machine I could get thousands of threads before hitting a limit. Rich. -- Richard Jones Red Hat