In defense of thousands of threads
Posted Aug 15, 2002 16:13 UTC (Thu) by
bhurt (guest, #3281)
In reply to:
Making Linux safe for pthreads by IkeTo
Parent article:
Making Linux safe for pthreads
The problem with user-space threads is that when one thread blocks, for whatever reason, all threads block. For library calls (read, write, etc) this can be worked around with some difficulty (does Linux support asynchronous I/O yet?). For page faults, the only work around is to spawn more threads than CPUs- that way, when one thread blocks due to a page fault another thread can run.
If you assume a couple dozen CPUs, each needing a couple dozen threads to make sure there is always at least one thread that is runnable, you get into thousands of threads really quickly.
Brian
(
Log in to post comments)