* [Caml-list] implementation of user-mode threads
@ 2004-05-08 23:42 Julien Verlaguet
0 siblings, 0 replies; only message in thread
From: Julien Verlaguet @ 2004-05-08 23:42 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-08 23:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-08 23:42 [Caml-list] implementation of user-mode threads Julien Verlaguet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox