caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>,
	caml-list@inria.fr
Subject: Re: Thread feature missing
Date: Tue, 15 Feb 2000 17:06:53 +0100	[thread overview]
Message-ID: <20000215170653.54672@pauillac.inria.fr> (raw)
In-Reply-To: <38A7B721.172F585C@univ-savoie.fr>; from Christophe Raffalli on Mon, Feb 14, 2000 at 09:04:49AM +0100

> Have I miss something ? I found that two features (especialy the first)
> are missing in the thread library:

No, you didn't miss anything.  The OCaml thread interface is somehow
constrained to the intersection of what can be implemented on top of
the virtual machine (for bytecode threads) and of what POSIX and Win32
threads provide (for system threads).

> - No way to wait for one thread to finish among many (equivalent of
> join, but taking a list of threads as argument)

This isn't supported directly in POSIX threads.  However, you can
easily program it yourself using e.g. events: allocate a channel, have
each thread send a message on it when it terminates, and wait for a
message on the channel.  The good thing about this method is that you
can put whatever you need in the message (thread ID, return value, etc).

> - No way to send a signal to a thread (it would be useful to make a
> thread raise an exception from another thread).

I agree this would be nice, and can easily be implemented in the case
of bytecode threads.  For POSIX threads, one could try using
cancellation to handle this, but I'm not sure it can be done in a
portable way.  For Win32 threads, I don't know how to do it.

- Xavier Leroy



  parent reply	other threads:[~2000-02-16  9:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-10 13:49 Typing problem jean-marc alliot
2000-02-11 10:17 ` Pierre Weis
2000-02-12 22:34   ` Jacques Garrigue
2000-02-14  8:04     ` Thread feature missing Christophe Raffalli
2000-02-14 15:11       ` Gerd Stolpmann
2000-02-15 16:06       ` Xavier Leroy [this message]
2000-02-16 11:31         ` Christophe Raffalli
2000-02-18  9:14           ` Xavier Leroy
2000-02-21 20:38             ` skaller
2000-02-22 11:15               ` Some questions about floatting point issues jean-marc alliot
2000-02-25 16:04                 ` Xavier Leroy

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=20000215170653.54672@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=Christophe.Raffalli@univ-savoie.fr \
    --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;
as well as URLs for NNTP newsgroup(s).