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 JAA21509; Tue, 12 Nov 2002 09:40:56 +0100 (MET) 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 JAA21505 for ; Tue, 12 Nov 2002 09:40:55 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gAC8er104517; Tue, 12 Nov 2002 09:40:53 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA05395; Mon, 11 Nov 2002 10:55:40 +0100 (MET) Date: Mon, 11 Nov 2002 10:55:40 +0100 From: Xavier Leroy To: Basile STARYNKEVITCH Cc: caml_list@inria.fr Subject: Re: [Caml-list] recursive mutexes? Message-ID: <20021111105540.B5171@pauillac.inria.fr> References: <15819.54873.817342.980555@hector.lesours> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <15819.54873.817342.980555@hector.lesours>; from basile@starynkevitch.net on Fri, Nov 08, 2002 at 04:20:57PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Does the Mutex module allow "recursive" mutexes No. A thread blocks forever if it attempts to lock a mutex it already locked before. > (the reference manual is not fully clear on this, and > it is an important point). I agree the documentation should be clearer on this point. > AFAIK some Posix threads accept recursive locking. Some do, but the POSIX 1003.1c standard specifies non-recursive mutexes only. There are endless arguments on the usefulness/evilness of recursive mutexes on comp.programming.threads; the jury is still out on this one. Of course, it is not difficult to implement recursive mutexes yourself on top of normal mutexes. You won't be able to use your recursive mutexes in conjunction with condition variables, though. - Xavier Leroy ------------------- 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