caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Zheng Li <li@pps.jussieu.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: [ANN] coThreads 0.10
Date: Tue, 18 Sep 2007 07:33:50 +1000	[thread overview]
Message-ID: <1190064830.6058.255.camel@rosella.wigram> (raw)
In-Reply-To: <87odg16uzh.fsf@pps.jussieu.fr>

On Mon, 2007-09-17 at 19:51 +0200, Zheng Li wrote:
> skaller <skaller@users.sourceforge.net> writes:
> > On Mon, 2007-09-17 at 18:48 +0200, Zheng Li wrote:
> >
> >> * The process engine can give you real speedup on multi-core and
> >>   multi-processor machines, the networker engine (todo) will give you both
> >>   speedup and scalability. 
> > I'm curious how this can be possible**.. is this only with the message
> > passing model? 
> > ** Since Ocaml can't multi-process and neither the compiler
> > nor library are modified ..
> 
> Well, in order to have semantic consistency among different engines without
> modifying standard OCaml itself, shard-memory style concurrency should only be
> achieved through the STM module. It's documented in the pitfall pages: 
> 
> http://cothreads.sourceforge.net/doc/pitfall

Yes but what I'm getting at is the claim of multi-processing,
which Ocaml 3.10 at least cannot do. If you run Ocaml on a multi-core
machine, even if you have 8 cores and 8 threads, one on each core,
only one will ever run at once, so there is no performance gain.
In fact, it will be slower than a single core.

If you are *enforcing* message passing and using separate processes
instead of threads, then 8 processes will run in parallel on 8 cores,
and you'll get roughly 8 times speedup.

So I'm not asking about how to ensure the code is consistent
over the various models, but rather how you can get ANY genuine
concurrency WITHOUT using message passing and processes
(in which case the networking model should be easy to implement)

Whether you explicitly send messages or use transactional memory
or whatever to wrap the message passing isn't the question:
I can see how that can work. However note, the message passing
has to be used for immutable values too, if the threads are
represented by processes in separate address spaces.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-09-17 21:32 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 16:31 Zheng Li
2007-09-17 16:48 ` Zheng Li
2007-09-17 17:39   ` [Caml-list] " skaller
2007-09-17 17:51     ` Zheng Li
2007-09-17 21:33       ` skaller [this message]
2007-09-17 22:37         ` Zheng Li
2007-09-17 23:26           ` [Caml-list] " skaller
2007-09-18  0:16             ` Zheng Li
2007-09-18  0:53   ` [Caml-list] " Erik de Castro Lopo
2007-09-18  1:25     ` Erik de Castro Lopo
2007-09-18  4:29     ` skaller
2007-09-19 10:11   ` Erik de Castro Lopo
2007-09-19 10:58     ` Can coThreads be used for message passing architecture? Jan Kybic
2007-09-19 11:13       ` [Caml-list] " Erik de Castro Lopo
2007-09-19 12:59         ` Zheng Li
2007-09-20  4:16         ` [Caml-list] " Jon Harrop
2007-09-20  6:11           ` Erik de Castro Lopo
2007-09-20  9:06             ` Zheng Li
2007-09-20  8:49           ` Zheng Li
2007-09-19 19:13   ` [Caml-list] Re: [ANN] coThreads 0.10 Vu Ngoc San
2007-09-19 20:10     ` Zheng Li
2007-09-20  0:50       ` [Caml-list] " skaller
2007-09-20  4:29         ` Erik de Castro Lopo
2007-09-20  7:11           ` skaller
2007-09-20  7:52             ` Erik de Castro Lopo
2007-09-20  8:37               ` Zheng Li
2007-09-20 10:43                 ` [Caml-list] " skaller
2007-09-20 10:44                   ` Matthew Hannigan
2007-09-20 15:02                     ` skaller
2007-09-20 15:07                       ` Christophe Raffalli
2007-09-20 15:51                         ` skaller
2007-09-20 16:26                       ` Florian Weimer
2007-09-20 17:37                         ` Vincent Aravantinos
2007-09-21 16:33                       ` readline license (was: [ANN] coThreads 0.10) Xavier Leroy
2007-09-21 17:11                         ` [Caml-list] " Matthew William Cox
2007-09-21 18:05                         ` skaller
2007-09-21 21:51                           ` [Caml-list] Re: readline license Markus E L
2007-09-21 22:16                             ` Daniel Bünzli
2007-09-22  0:49                           ` [Caml-list] Re: readline license (was: [ANN] coThreads 0.10) Matthew Hannigan
2007-09-20 11:39                   ` [Caml-list] Re: [ANN] coThreads 0.10 Florian Weimer
2007-09-20 15:46                     ` skaller
2007-09-20 18:14                       ` Ken Rose
2007-09-20  8:31           ` Zheng Li
2007-09-20  8:18         ` Zheng Li
2007-09-18  2:10 ` [Caml-list] " Erik de Castro Lopo
2007-09-18  5:59   ` skaller
2007-09-18  6:23     ` Erik de Castro Lopo
2007-09-18  9:01       ` Zheng Li
2007-09-18 13:40         ` Zheng Li
2007-09-18 23:53           ` [Caml-list] " Erik de Castro Lopo
2007-09-18  9:09       ` [Caml-list] " skaller
2007-09-18 13:03       ` Markus E L

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=1190064830.6058.255.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=li@pps.jussieu.fr \
    /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).