caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: itz@buug.org
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] vm threads
Date: Sat, 15 Oct 2005 14:23:04 +0900 (JST)	[thread overview]
Message-ID: <20051015.142304.106269859.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <8764rzbcw6.fsf@buug.org>

> Are Ocaml's VM threads preemptive?  That is, does the virtual machine 
> actually have a timer and give a slice to each thread?  Or does a thread
> run until it's blocked?

The timer signal is used, so they are preemptive.
This is however only true for threads running ocaml code.
There is no way to switch thread during C calls, so that all
potentially blocking C calls should be manually converted to
non-blocking ones (this is already done for the standard library and
the Unix module.)
This can also create problems when somebody else needs the timer
signal (for instance the Graphics module.)

System threads are most costly (they use system resources), but they
simplify greatly working with C.

     Jacques Garrigue


  reply	other threads:[~2005-10-15  5:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-15  4:52 Ian Zimmerman
2005-10-15  5:23 ` Jacques Garrigue [this message]
2005-10-15  5:52   ` [Caml-list] " Ian Zimmerman
2005-10-15  8:46     ` Jacques Garrigue

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=20051015.142304.106269859.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=itz@buug.org \
    /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).