[ECOS] Why to signal condvar with mutex held?

sandeep shimple0@yahoo.com
Sat Dec 11 15:39:00 GMT 2004

my 2 cents.

what about keeping the waitlists sorted in decreasing priority order of
threads, when you go with idea of wait morphing? won't this ensure that
highest priority waiting thread gets the mutex?

of course it doesn't cater to situation that Nick had mentioned -
 > If the thread doing the signalling has just preemted another thread
 > that was about to try to lock the mutex, and this preempted thread is
 > higher prioirity than the one on the condvar queue, then the morphing
 > approach would give the mutex to the lower priority thread. With the

but catering to this, can also lead to a situation where someone who has been
waiting for long remains waiting because of lower priority and could possibly
remain waiting for ever in some combination of things.

well, this kind of situation and unfairness is possible, rather more possible,
with the suggestion made at the beginning of the mail.

Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list