ggreer/the_silver_searcher — pull request #91 by c4rlo (2012-10-12 19:35:38+00:00)
Title: Threading tweaks

The main thing here is to use `pthread_cond_signal` instead of `pthread_cond_broadcast` when a new file has been added to the work queue. This wakes up one thread only (in the normal case; spurious wakeups are still possible), instead of all threads. In my testing (Linux x86_64), the performance gain starts being obvious only when using something like `--workers=200` (or higher).

I wonder whether it would make a difference to your profiling results that you gathered when you first introduced pthreads and found that it was slower on Mac with a high number of threads?