On Sat, Jun 09, 2007 at 07:12:35PM +0300, Shachar Shemesh wrote:
> Hi all,
> 
> In principle, a mutex needs to satisfy two conditions:
> 1. It should never ever ever allow two threads/processes in
> simultaneously (exclusion)
> 2. A blocked process/thread should know that, sooner or later, and
> assuming that other threads are occasionally releasing the threads, it
> will be allowed in (fairness).

POSIX says the second is optional.

> I have circumstantial evidence that pthread_mutex_lock on 2.6.18, at
> least on a single CPU machine, does not prevent starvation.

What happens if you you set thread scheduling to SCHED_FIFO (using
pthread_attr_setschedpolicy(SCHED_FIFO), assuming
_POSIX_THREAD_PRIORITY_SCHEDULING is defined on your system)?

Cheers,
Muli

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to