From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA04906; Sun, 9 May 2004 01:42:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA04731 for ; Sun, 9 May 2004 01:42:42 +0200 (MET DST) Received: from hotmail.com (sea2-f25.sea2.hotmail.com [207.68.165.25]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i48NgeSH016948 for ; Sun, 9 May 2004 01:42:41 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 8 May 2004 16:42:40 -0700 Received: from 82.224.161.100 by sea2fd.sea2.hotmail.msn.com with HTTP; Sat, 08 May 2004 23:42:39 GMT X-Originating-IP: [82.224.161.100] X-Originating-Email: [julien_verlaguet@hotmail.com] X-Sender: julien_verlaguet@hotmail.com From: "Julien Verlaguet" To: caml-list@inria.fr Subject: [Caml-list] implementation of user-mode threads Date: Sun, 09 May 2004 01:42:39 +0200 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 08 May 2004 23:42:40.0415 (UTC) FILETIME=[2697AAF0:01C43556] X-Miltered: at concorde with ID 409D7070.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; user-mode:01 threads:01 threads:01 unregistered:99 otherlibs:01 systhreads:01 posix:01 segfault:01 initialized:01 tryed:01 capel:99 slower:01 user-mode:01 ocaml:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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