thread scheduling at mutex unlock

Andriy Gapon avg at icyb.net.ua
Thu May 15 09:01:17 UTC 2008


David Schwartz wrote:
> Are you out of your mind?! You are specifically asking for the absolute =
> worst possible behavior!
> 
> If you have fifty tiny things to do on one side of the room and fifty =
> tiny things to do on the other side, do you cross the room after each =
> one? Of course not. That would be *ludicrous*.
> 
> If you want/need strict alternation, feel free to code it. But it's the =
> maximally inefficient scheduler behavior, and it sure as hell had better =
> not be the default.

David,

what if you have an infinite number of items on one side and finite 
number on the other, and you want to process them all (in infinite time, 
of course). Would you still try to finish everything on one side (the 
infinite one) or would you try to look at what you have on the other side?

I am sorry about fuzzy wording of my original report, I should have 
mentioned "starvation" somewhere in it.

-- 
Andriy Gapon


More information about the freebsd-stable mailing list