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 NAA29295; Wed, 12 May 2004 13:46:15 +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 NAA29887 for ; Wed, 12 May 2004 13:46:14 +0200 (MET DST) Received: from oxy.exomi.com (fa-3-0-0.fw.exomi.com [217.169.64.99]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4CBkCSH018781 for ; Wed, 12 May 2004 13:46:13 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by oxy.exomi.com (Postfix) with ESMTP id 285A720148F; Wed, 12 May 2004 14:46:13 +0300 (EEST) In-Reply-To: <40A20A0F.2070809@baretta.com> References: <40A115E3.1060400@frotz.com> <20040511180933.GB595@speakeasy.org> <40A20A0F.2070809@baretta.com> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: Shawn Wagner , caml-list@inria.fr, ranjan.bagchi@frotz.com From: Ville-Pertti Keinonen Subject: Re: [Caml-list] Best way to synchronize OS processes? Date: Wed, 12 May 2004 14:46:12 +0300 To: Alex Baretta X-Mailer: Apple Mail (2.613) X-Miltered: at concorde with ID 40A20E84.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 baretta:01 lockf:01 lockf:01 implemented:01 posix:01 ocaml:01 alex:01 synchronize:01 unix:02 unix:02 module:03 module:03 wrote:03 locks:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On May 12, 2004, at 2:27 PM, Alex Baretta wrote: > I disagree. I faced the same problem and found that it cannot be > easily solved with lockf. Unix.lockf locks specific regions in a file, > whereas Ranjan seems to need the equivalent of a mutex, which should > be implemented as a lock over the entire file. This is done by the > flock primitive in Posix systems. Unluckily, flock has not been > included in the Unix module. Actually flock is non-POSIX (it's BSD) and is missing from some reasonably modern systems. It's entirely possible to lock the entire file using the fcntl used by Unix.lockf, making it equivalent to flock. The problem is that the OCaml Unix module doesn't allow the l_whence parameter to be set, which is a serious omission. ------------------- 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