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
Usage of condition variables
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-17 (04:05)
From: malc <malc@p...>
Subject: Usage of condition variables

Recently in the process of discussing one problem i was having subject
temporarily switched to the condition variables:

Also according to:

The pthread_cond_broadcast() or pthread_cond_signal() functions may be
called by a thread whether or not it currently owns the mutex that threads
calling pthread_cond_wait() or pthread_cond_timedwait() have associated
with the condition variable during their waits; however, if predictable
scheduling behavior is required, then that mutex shall be locked by the
thread calling pthread_cond_broadcast() or pthread_cond_signal().

However it seems like members of OCaml team strongly prefer unlock
then signal pattern. Given that Xavier Leroy is also the author of
LinuxThreads there might be some good arguments to have it that way,
or maybe it's because of vmthreads, perhaps someone could give the

So far only this:
was in favour of unlock then signal.