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 UAA15054; Tue, 11 May 2004 20:24:14 +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 UAA18183 for ; Tue, 11 May 2004 20:24:09 +0200 (MET DST) Received: from sfoadmin02.irisfinancial.com (mail.irisfinancial.com [63.94.91.3]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4BIO7SH028383 for ; Tue, 11 May 2004 20:24:07 +0200 Received: from [127.0.0.1] (kauket.irisfinancial.com [200.0.1.206]) by sfoadmin02.irisfinancial.com (8.12.9/8.11.3/iris-20020401) with ESMTP id i4BIO4iX012243; Tue, 11 May 2004 11:24:05 -0700 (PDT) Message-ID: <40A11A46.5020704@frotz.com> Date: Tue, 11 May 2004 11:24:06 -0700 From: Ranjan Bagchi User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Shawn Wagner CC: caml-list@inria.fr Subject: Re: [Caml-list] Best way to synchronize OS processes? References: <40A115E3.1060400@frotz.com> <20040511180933.GB595@speakeasy.org> In-Reply-To: <20040511180933.GB595@speakeasy.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-Miltered: at concorde with ID 40A11A47.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 2004:99 serialize:01 lockf:01 0700,:01 synchronize:01 unix:02 unix:02 module:03 wrote:03 wrote:03 exceptions:04 executing:04 descr:05 descr:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Cool - I was playing with that call today, although I'm getting occasional EDEADLK exceptions thrown though. Is there an example of correct use? What I'm doing (code isn't handy right now) is before writing to the file, I get a write lock, write my bit, and then unlock the region. Reading bits try to get a Read lock, and then unlock when they're done. I'm using | in_channel_of_descr| and out_channel_of_descr to do the i/o -- is this a problem? Ranjan Shawn Wagner wrote: >On Tue, May 11, 2004 at 11:05:23AM -0700, Ranjan Bagchi wrote: > > >>Hi -- >> >>I'm writing some code which will end up executing concurrently on >>several OS processes. I'd like to serialize access to some specific OS >>resources (for instance, writing to a single file). The Unix module >>doesn't appear to offer anything like a critical section or an OS >>mutex. Is there a preferred way to do this? >> >> > >File locking with Unix.lockf? > > > > ------------------- 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