DÅ?a Utorok 21 FebruÃ¡r 2006 19:10 Daniel N. napÃsal:
Uh, yeah, that’s pretty much why not all code is threaded.
On the other hand, in programs above a certain size, or ones that have
graphical user interface, there usually is something else that you can
do while you’re waiting on that resource.
This is pretty much one of the few good reasons to use threads on a
single-core processor - to keep an interactive user interface
to give people that can’t wrap their heads around parallel processing
headaches making them code Dining Philosophers mutter
They also make life simpler in some scenarios - it’s definately easier
a multithreaded application with parallel asynchronous input (think
sniffing on multiple network interfaces) by hogging each with a thread
couldn’t care less about if it blocks, than using standard asynchronous
which isn’t even available for all input sources.