On Wed, 2003-05-21 at 12:40, Duraid Madina wrote: > Dear Arjan, > > > /////// > // O > // > This is a graduate > / \__ ~ student, laboratory > || ///// assistant, automotive > (\ \) (~) // o <--- engineer or other > ( \ \ / / // > unfortunate soul > ( \ \/ / ____________/ \__O attempting to get > ( \__/ / ___ ______\// performance out of a > / | /@ ( / / ______)/ machine running Linux > ( |// \ \ / / (_) by writing a simple > \ () \ \O/ and correct > \ | ) ) multithreaded program. > ) ) / / > ( |_ / /_ > (____> (____> > > ^ > | > | > | > | > > This is you. > > if you had spent the time you spent on this colorful graphic on reading SUS or Posix about what sched_yield() means, you would actually have learned something. sched_yield() means "I'm the least important thing in the system". It's the wrong thing for cross-cpu spinlocks; futexes are optimal for that. For letting higher priority tasks run a sleep(0) is also far more closer to the right behavior than a sched_yield().