caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: skaller <skaller@users.sourceforge.net>
Cc: Jon Harrop <jon@ffconsultancy.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] CallCC using fork (and garbage collected processes)
Date: Mon, 16 Jul 2007 17:46:43 +0100	[thread overview]
Message-ID: <20070716164643.GB26691@furbychan.cocan.org> (raw)
In-Reply-To: <1184566043.8152.55.camel@rosella.wigram>

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


  reply	other threads:[~2007-07-16 16:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16  5:30 Jon Harrop
2007-07-16  6:07 ` [Caml-list] " skaller
2007-07-16 16:46   ` Richard Jones [this message]
2007-07-16 17:25     ` skaller
2007-07-16 17:57       ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070716164643.GB26691@furbychan.cocan.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).