English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-02-16 (19:06)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] interprocess mutex
Janne Hellsten wrote:
> 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.

Unix.lockf is the way to go.


Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)

The FreerP Project