Cost of a thread in C++ under Linux
Threads are very expensive if you start throwing C++ exceptions within them in parallel.  You see the overall time to join the threads increases with each thread you add. There is a mutex in the unwinding code and as the threads grab the mutex they invalidate each other's cache line. I wrote a demo to illustrate the problem https://github.com/clasp-developers/ctakMacOS doesn't have this problem but Linux and FreeBSD do.