Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
interprocess mutex
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Frédéric_Gava <gava@u...>
Subject: Re: [Caml-list] interprocess mutex

you could also used threads. It is easier.

After you could used "Mutex", "Condition" and "Event" to synchronise your

To synnchronise true "process", you could used "waitpid".

Frédéric Gava

> Hello,
> I need to sequentialize two processes accessing the same GDBM database
> (OCaml's dbm library).  Since GDBM allows for only one writer at a time,
> I need a way to block until the previous writer has finished.  I think
> there is a way to do this with the original GDBM library since it claims
> to handle the file lockings properly -- I could block based on the
> returned error codes.  However, this functionality does not appear to be
> exposed through the Dbm module.
> Of course I can implement this blocking myself with an interprocess
> mutex.  But how can I implement such a mutex in OCaml?  I couldn't find
> anything from the standard library that would resemble my problem.
> Is it easily doable or do I need to go and start hacking C code?  I've
> never done it on Unix but I know it's easily done on Windows.
> Thanks in advance,
> Janne
> P.S.  I'm using GDBM merely as a cache between process invocations, so
> using a more heavyweight DB is out of the question.
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports: