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 TAA30581; Tue, 18 Mar 2003 19:43:41 +0100 (MET) 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 TAA30615 for ; Tue, 18 Mar 2003 19:43:40 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from opus.davidb.org (66-27-72-19.san.rr.com [66.27.72.19]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2IIhdf00195 for ; Tue, 18 Mar 2003 19:43:39 +0100 (MET) Received: from davidb by opus.davidb.org with local (Exim 3.31 #1 (Debian)) id 18vM3e-0007Zm-00; Tue, 18 Mar 2003 10:43:30 -0800 Date: Tue, 18 Mar 2003 10:43:30 -0800 From: David Brown To: Alessandro Baretta Cc: Ocaml Subject: Re: [Caml-list] Question on Mutexes Message-ID: <20030318184330.GA17623@opus.davidb.org> References: <3E772105.2000307@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E772105.2000307@baretta.com> User-Agent: Mutt/1.4i X-Spam: no; 0.00; caml-list:01 mutexes:01 alessandro:01 baretta:01 posix:01 threads:01 toplevel:01 checking:01 thread:02 dave:03 wrote:03 locks:03 execute:04 exceptions:04 stuff:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Mar 18, 2003 at 02:37:09PM +0100, Alessandro Baretta wrote: > If thread t1 locks mutex m, can thread t2 unlock it? > > I ask because I get no sign of exceptions being thrown when > I execute the following code in the toplevel: Most mutex implementations I've seen assume that the unlock is done by the same thread. Posix threads allows you to enable error checking, to check for this case. However, it does cause a performance hit. Perhaps the mutex stuff could be wrapped in something that would check for the error? Dave ------------------- 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