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: Luca Pascali <luca@b...>
Subject: Re: [Caml-list] Mutex and posix
Alex Baretta wrote:

> Luca Pascali wrote:
>> Just a little question, my curiosity about the thread module.
>> I found in Posix (this is from 'info libc' page on section Mutexes) 
>> these three functions
>> Function: int pthread_mutex_lock (pthread_mutex_t *mutex))
>> Function: int pthread_mutex_trylock (pthread_mutex_t *MUTEX)
>> Function: int pthread_mutex_timedlock (pthread_mutex_t *MUTEX, const 
>> struct timespec *ABSTIME)
> You can probably simulate the third one fairly well by resorting to 
> as a timer, but why in the world would you want to lock 
> for a while and then forget about it?
> Besides --- given Machiavelli works in an asynchronous, event-modeled 
> world --- why would want to use synchronous primitives such as timedlock?
> Alex

It's not about Machiavelli. It was just a curiosity (We spoken 
personally a few months ago).
I staied with the doubt about the missing of this function and I thought 
that asking to the list was the best thing to do for having an answer. 
And it was.


Luca Pascali
Baretta DE&IT
A division of Baretta SRL

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

Our technology: