Subj : Re: Futexes are wrong! (Are they?) To : comp.programming.threads From : Jomu Date : Tue Jun 07 2005 04:18 pm David Butenhof wrote: .... > > This may force the waiting thread(s) to wake up just to find out that > > the condition is not true and fall back to wait on the condvar again. > > Yup. That's life in a concurrent world. But this is GOOD; because if the > predicate is no longer true, it means the APPLICATION (and user) > benefited by some other thread being able to process the condition > earlier than the awakened thread could get through the scheduler, > acquire the mutex, and so forth. Threads are cooperative, not > competitive; it's the PROCESS throughput that matters. If you think of > it that way, you'll get yourself into less trouble. (And avoid > unnecessarily twisting your mental model.) > > That's one reason why thread-per-client is bad; it tries to force > threads to COMPETE for resources, and they simply can't do that > effectively -- they're inherently co-dependent because of the state they > share. Why would this be more competition than N-clients-per-thread, except in order of magnitude? Won't we loose some of threads readability and clarity when we multiplex clients in same code flow? Isn't that hybridization of threads with event driven programming? dd .