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 PAA21661; Sun, 5 Sep 2004 15:57:49 +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 PAA20996 for ; Sun, 5 Sep 2004 15:57:48 +0200 (MET DST) Received: from ppsw-6.csi.cam.ac.uk (ppsw-6.csi.cam.ac.uk [131.111.8.136]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i85DvlGV021720 for ; Sun, 5 Sep 2004 15:57:48 +0200 Received: from zone-7.jesus.cam.ac.uk ([131.111.243.37]:34684 helo=pooh.jc) by ppsw-6.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtp (TLSv1:RC4-MD5:128) (Exim 4.34) id 1C3xWb-0001Tc-5K (return-path da209@cam.ac.uk); Sun, 05 Sep 2004 14:57:45 +0100 From: Daniel Andor To: Janne Hellsten , caml-list@inria.fr Subject: Re: [Caml-list] Unix module and threads Date: Sun, 5 Sep 2004 14:57:44 +0100 User-Agent: KMail/1.7 References: <413AC784.4010007@hybrid.fi> <20040905134246.GA8829@fichte.ai.univie.ac.at> In-Reply-To: <20040905134246.GA8829@fichte.ai.univie.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409051457.44760.da209@cam.ac.uk> X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ X-Cam-AntiVirus: No virus found X-Cam-SpamDetails: Not scanned X-Miltered: at nez-perce with ID 413B1B5B.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 2004:99 foo:01 threads:01 thread-safe:01 sep:01 mottl:02 unix:02 unix:02 module:03 wrote:03 wrote:03 markus:04 daniel:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 05 September 2004 2:42 pm, Markus Mottl wrote: > On Sun, 05 Sep 2004, Janne Hellsten wrote: > > I wonder what happens if I call [Unix.chdir foo] from two different > > threads, with two different directories? > > This is not thread-safe: threads share the current working directory of > the process. > > > After chdir I typicall call [Unix.system] and/or > > [Unix.open_process_full] and expect the directory to be the one just > > previously set with [Unix.chdir]. If you absolutely must use chdir, perhaps you could use a mutex (a `path' mutex, if you like) to control modification of the process working directory? D ------------------- 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