caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: briand@aracnet.com
Cc: skaller@users.sourceforge.net,
	Ville-Pertti Keinonen <will@exomi.com>,
	caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] exene and ocaml ?
Date: 11 Apr 2004 18:41:53 +1000	[thread overview]
Message-ID: <1081672912.20677.340.camel@pelican> (raw)
In-Reply-To: <16504.59825.814348.947278@soggy.deldotd.com>

On Sun, 2004-04-11 at 16:46, briand@aracnet.com wrote:

> I was thinking about that statement... Is that really true ?  If I
> only have maybe something like 5-10 threads running, why would it be
> such a problem ?

Probably it wouldn't, but not the reference is to:
  >> I wouldn't use or recommend a massively multithreaded approach

> I know almost nothing about the efficiency of posix threads.

The problem isn't "posix threads" per se, but Unix.
It isn't possible to use Unix kernel scheduling for efficient
task switching. Even highly optimised systems like Solaris
are required to cope with complex conditions which make
it expensive to schedule a time slice.

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, but there isn't enough address space
for that .. even on a 64 bit machine the position is 
not good.

So actually -- FAR from the garbage collector being
a problem, the situation is exactly the opposite.
It is the heavy memory demands of the linear stack
which creates a problem a GC would have no problem
dealing with.

Felix solves some of these problems by
cooperatively multi-tasking procedural
continuations allocated on a GC managed heap
and allows O(1) event driven scheduling.
The architecture should support a GUI with
one thread for every window (and I mean 
X level window not widget), a game with
10,000 sprites, a telco system managing
100K concurrent phone calls, or any other
problem where you can factor your need
for threads of control into

(1) A few concurrent Unix style threads

(2) A huge number of threads doing almost
no work which can be scheduled on an 
event basis.

A typical architecture would divide the
Unix threads into a worker for each CPU
which drives the cooperative threading
on that CPU, and some I/O threads to
gather and dispatch events between the
worker event queues and the hardware.

This model isn't useful for all problems.
[eg -- it doesn't seem to fit parallel numerical
computing needs]

It also needs augmentation to include
persistence/network transparency to
support mobile agents, for example.

Felix generates C++, but an Ocaml back end
would be quite interesting ..

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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  8:42 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 [this message]
2004-04-11  9:02             ` Richard Jones
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=1081672912.20677.340.camel@pelican \
    --to=skaller@users.sourceforge.net \
    --cc=briand@aracnet.com \
    --cc=caml-list@pauillac.inria.fr \
    --cc=will@exomi.com \
    /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).