Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: malc <malc@p...>
Subject: Usage of condition variables
Hello,

Recently in the process of discussing one problem i was having subject
temporarily switched to the condition variables:
http://groups.google.com/group/comp.unix.programmer/tree/browse_frm/thread/5394d00781547266/17c8a349edae9d3c?rnum=1_done=%2Fgroup%2Fcomp.unix.programmer%2Fbrowse_frm%2Fthread%2F5394d00781547266%2F17c8a349edae9d3c%3Ftvc%3D1%26q%3Dmalc%26#doc_b586db199a5fd81a

Also according to:
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cond_signal.html

<quote>
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().
</quote>

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
rationale?

So far only this:
http://groups.google.com/group/comp.unix.programmer/msg/02751100d1b953e3
was in favour of unlock then signal.

--
mailto:malc@pulsesoft.com