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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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. 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