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 PAA20519; Sun, 5 Sep 2004 15:43:00 +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 PAA21232 for ; Sun, 5 Sep 2004 15:42:57 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i85DguXl000958 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 5 Sep 2004 15:42:57 +0200 Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i85DglDu010557; Sun, 5 Sep 2004 15:42:47 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i85Dglfb010556; Sun, 5 Sep 2004 15:42:47 +0200 Date: Sun, 5 Sep 2004 15:42:47 +0200 From: Markus Mottl To: Janne Hellsten Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix module and threads Message-ID: <20040905134246.GA8829@fichte.ai.univie.ac.at> Mail-Followup-To: Janne Hellsten , caml-list@inria.fr References: <413AC784.4010007@hybrid.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <413AC784.4010007@hybrid.fi> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 413B17E0.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 foo:01 threads:01 thread-safe:01 parallelize:01 sep:01 mottl:02 mottl:02 unix:02 unix:02 module:03 wrote:03 contexts:03 markus:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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]. > > I would like to parallelize a simple building tool that I've written, > but I'm a bit worried if things will mysteriously break with the > introduction of multi-threaded control. Always use absolute paths to avoid problems in multi-threaded contexts. Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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