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: caml-list@inria.fr
Subject: Re: [Caml-list] exene and ocaml ?
Date: Sun, 11 Apr 2004 10:02:00 +0100	[thread overview]
Message-ID: <20040411090200.GA5788@redhat.com> (raw)
In-Reply-To: <1081672912.20677.340.camel@pelican>

On Sun, Apr 11, 2004 at 06:41:53PM +1000, skaller wrote:
> Also, small address space processors cannot cope
> with the linear addressing problem: unlike processes,
> threads share address space. If you have a lot of threads
> you need a lot of stacks, and they all have to grow
> 'arbitrarily' large,[...]

I did some experiments with early versions of pthrlib (see .sig) where
I tried swapping stacks in and out during context switches using
mmap(2).  All thread stacks were located at the same address in
memory, thus sidestepping the address space problem.  It sort of can
be made to work: It was about 3 years ago, so I forget the exact
problems, but they were probably related to the fact that you need to
back each stack with a disk file, and it doesn't work well with the
normal GROWSDOWN behaviour of stacks.  Plus it's probably a lot slower
because you're trashing the disk cache / data cache and TLB on each
switch.

If you do this you have to be careful not to share data on the stack
between threads (not normally a problem).

BTW, very interesting your comments on Control Inversion.  I think
you're absolutely spot-on with that, and you should write up a node on
the Portland Wiki about it.  I don't think the term "Control
Inversion" is well-known, although it should be.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
PTHRLIB is a library for writing small, efficient and fast servers in C.
HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-04-11  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-01  4:08 briand
2004-04-01  7:25 ` Ville-Pertti Keinonen
2004-04-01  8:19   ` skaller
2004-04-01  9:24     ` Ville-Pertti Keinonen
2004-04-01 14:08       ` skaller
2004-04-11  6:46         ` briand
2004-04-11  8:41           ` skaller
2004-04-11  9:02             ` Richard Jones [this message]
2004-04-11  9:26               ` skaller
2004-04-11 13:21           ` Ville-Pertti Keinonen
2004-04-01 14:34       ` skaller
2004-04-02  5:09       ` briand

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=20040411090200.GA5788@redhat.com \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --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).