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 NAA05402; Fri, 16 Apr 2004 13:22:40 +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 NAA05308 for ; Fri, 16 Apr 2004 13:22:39 +0200 (MET DST) Received: from mail0.epfl.ch (mail0.epfl.ch [128.178.50.57]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i3GBMcYM013645 for ; Fri, 16 Apr 2004 13:22:38 +0200 Received: (qmail 1960 invoked by uid 107); 16 Apr 2004 11:22:37 -0000 Received: from mailav1.epfl.ch (HELO MAILAV1) (128.178.50.190) by mail0.epfl.ch with SMTP; 16 Apr 2004 11:22:37 -0000 Received: From mail0.epfl.ch ([128.178.50.57]) by MAILAV1 (WebShield SMTP v4.5 MR1a P0803.345); id 1082114762140; Fri, 16 Apr 2004 13:26:02 +0200 Received: from lamp2priv1.epfl.ch (128.178.154.46) by mail0.epfl.ch (AngelmatoPhylax SMTP proxy); Fri, 16 Apr 2004 13:22:36 +0200 In-Reply-To: <407FB5BA.10607@univ-savoie.fr> References: <407FB5BA.10607@univ-savoie.fr> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <83FD8472-8F98-11D8-9A79-000393DBC266@epfl.ch> Content-Transfer-Encoding: quoted-printable Cc: caml-list@inria.fr From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: [Caml-list] Thread in OCaml Date: Fri, 16 Apr 2004 13:23:41 +0200 To: Christophe Raffalli X-Mailer: Apple Mail (2.613) X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 raffalli:01 threads:01 -thread:01 interfere:01 callbacks:01 callback:01 ecrit:01 christophe:01 ocaml:01 ocaml:01 caml:01 caml:01 blocking:01 blocking:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Le 16 avr. 04, =E0 12:30, Christophe Raffalli a =E9crit : > 1) why the name enter(resp leaving)_blocking_section to release(resp=20= > aquire) a mutex ? you aquire a mutex when you want to block other=20 > threads. The name seems inversed to me and this did not help. I guess it is to suggest that you are going to enter a section where C=20= calls may block. The names were given from the perpsective of what=20 happens between enter/leave. In my opinion, what really doesn't help is that it is not documented=20 _at all_ in the the manual... > 2) is there a way to have two files wrap_glut.c one with=20 > enter/leaing_blocking_section the other without (or MACROS), the right=20= > file being used depending if the -thread or -vmthread option is given Using a library should not interfere with other part of the ocaml=20 system. Since glut has this (bad) idea of a loop that never returns=20 enter/leave_blocking_section should _always_ be used in the stubs so=20 that signal handlers (see Sys.signal) can be executed. Note that in=20 that case it is important that the callbacks from C into caml=20 reacquires the lock via leave_blocking_section and releases it after=20 (or a signal handler could be executing caml code concurrently with a=20 callback). Daniel P.S. In your previous post is not clear to me what you are actually=20 measuring.= ------------------- 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