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 MAA23780; Fri, 16 Apr 2004 12:26:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA23532 for ; Fri, 16 Apr 2004 12:26:40 +0200 (MET DST) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3GARgjq028220 for ; Fri, 16 Apr 2004 12:27:42 +0200 Received: from univ-savoie.fr (d85.lama.univ-savoie.fr [193.48.123.85]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id i3GAU3bM007316 ; Fri, 16 Apr 2004 12:30:03 +0200 Message-ID: <407FB5BA.10607@univ-savoie.fr> Date: Fri, 16 Apr 2004 12:30:18 +0200 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] Thread in OCaml X-Enigmail-Version: 0.83.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8D95333714C441C321E26110" Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; raffalli:01 raffalli:01 univ-savoie:01 openpgp:01 2440:01 3156:01 threads:01 threads:01 -thread:01 runtime:01 allocating:01 runtime:01 speedup:01 savoie:01 chablais:01 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8D95333714C441C321E26110 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit My recent problems with threads suggest the following questions 1) why the name enter(resp leaving)_blocking_section to release(resp aquire) a mutex ? you aquire a mutex when you want to block other threads. The name seems inversed to me and this did not help. 2) is there a way to have two files wrap_glut.c one with enter/leaing_blocking_section the other without (or MACROS), the right file being used depending if the -thread or -vmthread option is given 3) I know a little (not much) about the runtime system of OCaml and I think (probably wrongly), that it would be enough to aquire a mutex when allocating heap object (for this you need a list of grey-val for each thread but it should not be difficult). What am I missing about the runtime ? If you think a typical Caml program spend 20% of time during allocation(which include GC) then 5 threads could run concurrently on 5 CPUs with some speedup (up to 5 times in the best case). Remark: for me it is to the programmer to add mutex if a mutable is being written/read by more that one thread. -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature --------------------------------------------- --------------enig8D95333714C441C321E26110 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAf7W6SQDyWB/+xBwRAgO/AKCrmCETCD7KRWC5YgwYwmoY2ZcVIQCfVuAx mwRJmzU9H/hi1lGqxqE8u2k= =L0zT -----END PGP SIGNATURE----- --------------enig8D95333714C441C321E26110-- ------------------- 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