How can I estimate the minimum amount of work it is worth spawning a new thread? I'm principally interested in C++11 std::thread
.
Long explanation. I was trying to speed up our application so I went on parallelizing a low level function, that perform very few and simple operations (such as inequalities and assignments) in a loop. This function is the most time consuming in the application, though. So I tried to parallelize the loop spawning two threads for two consecutive indices of the loop, but this killed performance (I can't say exactly the slow down factor, but it could be around 100x).