On 03/06/2013 07:10 PM, Graham wrote:
Alexandre wrote:
That's what the existing code already does.
Indeed. I don't know what I was thinking...
- If you're about to block on select(), then I don't see any point in
preceding that with a call to sched_yield().
This was added for a reason; most likely you'll have to write tests.
i.e. commit 8099c2b9. JW says "... to more closely resemble Windows behavior. The key is to yield in a Sleep..."
JW is Jeremy White so us old timers chuckle now ;)
I haven't yet figured out how he came up with this analysis, but I think it's safe to assume that he is correct, and my patch is garbage. Lesson learned: consult history.
"Date: Tue Nov 2 19:32:03 2004 +0000" and the comment mentions Win2K. If the ancient wisdom isn't backed by tests there's a fair chance that it might not be applicable today. Or that it was a wrong theory back then too.
bye michael