DemonGiggle/thread_issues — pull request #2 by arton0306 (2012-11-10 01:34:34+00:00)
Title: Arton

condition variable version

I think the condition variable can avoid extra cpu occupy.
For example, if we change the max thread count to 4 or the number of our cores.
The polling in "while" will decrease the performance.

Finally, it is faster than polling version when MAX_THREAD_COUNT is 4,
but MUCH slower in other condition.

(The first commit is a polling version with the same logic but with polling.)