Subj : Re: thread suspend using pthreads? To : comp.programming.threads From : David Schwartz Date : Sun Sep 04 2005 03:04 pm "Marcin 'Qrczak' Kowalczyk" wrote in message news:87zmqt6cea.fsf@qrnik.zagroda... > "David Schwartz" writes: >> I totally disagree. In fact, the reality is quite the reverse. OSes >> keep working harder and harder to make brain-damaged applications >> work well. An application should reuse its threads and use thread >> pools. It should not expect to be able to quickly create large >> numbers of threads only to destroy them. I have seem to much cruft >> in the OSes that impair the performance of well-written programs >> where the justification is that it makes badly written programs >> perform better. > I semi-disagree. Maintaining thread pools should not be the > responsibility of application code but of threading libraries. > Applications should use an abstraction which assumes that threads > are cheap. That's not the POSIX way. The POSIX way is to provide you with the simplest possible functions so that you can implement what you want exactly the way you want it. Why have a thread pool layer in the OS just so applications that stupidly create and destroy threads can perform better when well-written applications that use thread pools have to pay for an extra layer of overhead they don't want? It is not the POSIX way to give you, and make you pay for, anything you can do yourself. If you're saying that threading libraries on top of POSIX should provide thread pools, I don't disagree. If you're saying the OS and system thread library should, I totally disagree. DS .