Originally Posted by
grumpy
There is plenty wrong with using terms to mean something different from what others expect. It is like asking a question in english, and expecting a native japanese speaker to give you a useful answer. No matter how intelligent people might be, it is counter-productive (or, at best, inefficient) to speak to them using language and meanings they are not familiar with.
My personal experience is that there are trade-offs. There are some circumstances where spawning threads is more convenient/useful than waiting on conditions. And other circumstances where the reverse is true. There are also alternatives that sometimes surpass either technique (and sometimes not).
Such is the nature of engineering trade-off. There are often no absolute answers. What may be considered better on one machine (computer, operating system, operating system version, etc) may be woefully deficient on another.
It all comes down to requirements. Sometimes to meet highly specific requirements, it is necessary to be selective of hardware, operating system, as well as in your software design. If, for example, your timing requirements are relaxed, the software will run as required on a wider range of hardware.
Good luck on that. I've lost count of the number of researchers, and number of PhD projects, that seek to define some universal approach to capturing requirements, translating those requirements into software, etc etc. Every time someone comes up with their perceived panacea, some other researcher or some real-world practitioner comes up with a counter-example that demonstrates their approach does not always work.
The same is true of advanced threading. Firstly, there is formally no threading in C. Threading is outside the scope of the C standard. All threading relies on some library that is specified outside the C standard (for example, the IEEE POSIX specification). Second, even if you settle on using some threading API (be it POSIX, win32 threading functions, or whatever) you are in the realm of functionality that is highly operating system dependent. Different operating systems optimise different attributes that affect the overhead of things like process creation, thread creation within threads, creating and triggering semaphores, etc. So the relative performance of (say) creating a thread pool versus creating a new thread every time one is needed are highly operating system dependent.
And then you get into hardware dependence: how the CPU, memory system, etc is optimised around some performance parameters rather than others.