Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pawel Wojciechowski <Pawel.Wojciechowski@cl.cam.ac.uk>
To: caml-list@inria.fr
Cc: Pawel.Wojciechowski@cl.cam.ac.uk
Subject: threads library in Objective Caml
Date: Mon, 14 Apr 1997 10:35:10 +0100	[thread overview]
Message-ID: <E0wGiAL-0003qE-00@heaton.cl.cam.ac.uk> (raw)


The potential advantage of threads is that on a multiprocessor shared memory 
machine, each thread can run on a different processor. However, in the (O)Caml 
documentation is written as follows: "The `threads' library is implemented
by time-sharing on a single processor. It will not take advantage of multi-
-processor machines. Using this library will therefore never make programs 
run faster".

When writing concurrent porgrams, it is essential to handle concurrency 
properly, and that means assigning threads dynamically.  It is vital that
the threads are recognised at kernel level for independent allocation of
processor resource (otherwise it's "block one, block all", which is
intolerable). 

Assuming that the threads library of the (O)Caml is implemented by using 
the POSIX Unix thread library, in the light of the previous paragraph, it 
seems to me that using threads in programs written purely in Caml is less
powerful (in terms of the program behaviour on multi-processor architecures)
that using threads in a program written in C. Could you briefly explain 
this ?

On the other hand, on a single processor architecture, programs written
in Caml or C should take advantage of using threads library in exactly the 
same way. Am I right?

Pawel







             reply	other threads:[~1997-04-14 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-14  9:35 Pawel Wojciechowski [this message]
1997-04-14 17:06 ` Francois Rouaix
1997-04-15  3:51 ` Frank Christoph
1997-04-15  8:41 ` pcuoq

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=E0wGiAL-0003qE-00@heaton.cl.cam.ac.uk \
    --to=pawel.wojciechowski@cl.cam.ac.uk \
    --cc=caml-list@inria.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