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 RAA24618; Sun, 5 Sep 2004 17:27:17 +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 RAA24373 for ; Sun, 5 Sep 2004 17:27:16 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i85FRDIn012005 for ; Sun, 5 Sep 2004 17:27:15 +0200 Received: from [192.168.1.200] (ppp210-32.lns2.syd3.internode.on.net [203.122.210.32]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i85FR2HY005061; Mon, 6 Sep 2004 00:57:04 +0930 (CST) Subject: Re: [Caml-list] Unix module and threads From: skaller Reply-To: skaller@users.sourceforge.net To: janne@hybrid.fi Cc: caml-list In-Reply-To: <413B1A52.8060007@hybrid.fi> References: <413AC784.4010007@hybrid.fi> <20040905134246.GA8829@fichte.ai.univie.ac.at> <413B1A52.8060007@hybrid.fi> Content-Type: text/plain Message-Id: <1094398021.3352.655.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 06 Sep 2004 01:27:02 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 413B3051.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 threads:01 sourceforge:01 2004:99 threads:01 clarifying:01 work-around:01 portably:01 thread-safe:01 9660:01 glebe:01 nsw:01 snail:02 unix:02 unix:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 2004-09-05 at 23:53, Janne Hellsten wrote: > Thank you Markus and David, this is sort of what I was afraid of (e.g., > curdir is shared among threads). Thank you for clarifying this. > > As my build scripts require the working directory to be set, I think I > have to work-around this and do something along the lines of: > > Unix.system "cd my_working_dir && build_cmd" > > I wonder if there's some other way of doing this portably and in a > thread-safe fashion? You could do this: (1) use a mutex to freeze the current directory (2) launch a new process (and return without waiting) (3) release he mutex (4) wait for the process -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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