This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_cond_wait does not relock mutex on release


Robert and Gerald:

         Both quite right.  Although adding the SAFE_PRINTF made no 
difference in the 
output, checking a condition value in a loop made all the difference.  
Putting a printf in the loop revealed to my surprise that "spurious wakeups" 
were occurring thousands of times per second.  I had naively assumed that a 
condition would stay set until signalled.  Now I'm led to wonder if a 
condition variable is any performance improvement over a simple loop and 
short sleep.  Any thoughts?

         Thanks very much for your time and effort.  It was a great help.

-- Michael


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]