[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Thread starvation with mutex



On Mon, 9 Feb 2004, Gary S. Robertson wrote:

> System/library function calls should be engineered to reliably perform
> the operations their names and documentation suggest will occur when
> they are invoked - otherwise they should return with an error.  In this
> case, if the programmer calls pthread_mutex_unlock, then most likely the
> intent is to yield the mutex to the next waiting pthread, if any.

I disagree, I would think that the intent for pthread_mutex_unlock would
be to unlock the mutex according to the way POSIX Threads are supposed to
unlock mutexes.  If I want to yield a mutex to another thread, I would use 
a condition variable.

- D




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]