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
Mutex and posix
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-19 (09:34)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Mutex and posix
Brian Hurt wrote:
> On Mon, 17 Jan 2005, Alex Baretta wrote:
>>I am aware of this. But, if one really needs the timed primitive, one 
>>can always simulate it by sampling the mutex state repeatedly with 
>>_trylock. Unix.select serves the purpose of controlling the sampling time.

> Um, no.  What happens if the mutex is unlocked for some period of time 
> between your polls, but relocked before you poll the lock again?  It's 
> very easy to hit livelock conditions doing this.
> Brian

Of course it is. My solution is only a kludge to simulate an OS 
primitive on a system where it is not available. I am not stating that 
my strategy yields a POSIX compliant timedlock.


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