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 SAA12487; Wed, 12 May 2004 18:36:01 +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 SAA12520 for ; Wed, 12 May 2004 18:35:59 +0200 (MET DST) Received: from sfoadmin02.irisfinancial.com (mail.irisfinancial.com [63.94.91.3]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4CGZtEV013655 for ; Wed, 12 May 2004 18:35:58 +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 i4CGZqiX001478; Wed, 12 May 2004 09:35:53 -0700 (PDT) Message-ID: <40A25265.2030903@frotz.com> Date: Wed, 12 May 2004 09:35:49 -0700 From: Ranjan Bagchi User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr CC: Shawn Wagner Subject: Re: [Caml-list] Best way to synchronize OS processes? References: <40A115E3.1060400@frotz.com> <20040511180933.GB595@speakeasy.org> <40A11A46.5020704@frotz.com> In-Reply-To: <40A11A46.5020704@frotz.com> 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 nez-perce with ID 40A2526B.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 Incidentally -- I found my problem -- basic Unix system programming, I needed to seek back to the start of the area before attempting to unlock it. D'oh! Ranjan Ranjan Bagchi wrote: > 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