Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Julien Verlaguet" <julien_verlaguet@hotmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] implementation of user-mode threads
Date: Sun, 09 May 2004 01:42:39 +0200	[thread overview]
Message-ID: <Sea2-F25t61moPW5oC2000157aa@hotmail.com> (raw)

We are writting (a friend and me), the ocaml implementation of Fair Threads 
(http://www-sop.inria.fr/mimosa/rp/FairThreads).
We wrote a first implementation on top of the ocaml threads.
But to make a more efficient version we wrote a second version on top of the 
Pth threads (http://www.gnu.org/software/pth/).
To make the whole work properly we first had to rewrite the ocaml threads 
using this library.
It seems to work but a few questions are still pending, here they are :

  - Each time a thread switches his contex, his stack is registered as a 
global root, and the new running thread is unregistered, to avoid the GC to 
do the work twice on the stack. Is it slow ? I saw in the 
otherlibs/systhreads/posix.c a "hook", can I use it from "outside" ? because 
I would like the library to be usable without recompiling ocaml.

  - For the bytecode version, there is a segfault which seems to be a big 
issue. The pth threads to work properly need to be initialised (as first 
instruction in the main), and of course the first thing to be initialized on 
the bytecode version is not the pth mode. We tryed to modify startup_code 
but didn't work. We had a look at the library 
http://www.pps.jussieu.fr/~capel, but it would be better if the library 
could be usable directly in caml (without a main in C). Anyway, are 
vmthreads slower ? Because if they are not we could keep our implementation 
on top of caml threads for the bytecode mode ...

  - Apparently the pth threads can not be used with windows. Does any 
binding from a "user-mode thread library for windows" to caml exist ?

Finally, the threads seem to react fine with C code without any mutex (BUT 
THEY ARE COOPERATIVE!! ... that's why it works). If u are not scared of 
cooperative threads and u need to bind some C code with caml code u can 
contact us (we are trying to finish as soon as possible).

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

-------------------
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-05-08 23:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Sea2-F25t61moPW5oC2000157aa@hotmail.com \
    --to=julien_verlaguet@hotmail.com \
    --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