I use perf to do performance profiling, and get the following flame graph. Notice that a big portion of the total samples is pthread_cond_wait
. I used boost::asio
but not sure where is pthread_cond_wait
is called. Can anyone give me some clue why this is happening. Thanks.
That means you have a lot of lock contention. Without code there's little useful we can say, except generalities:
Going from the flame-graph alone I will add the tip that it is possible to optimize Asio in the case of single threaded application. See Concurrency Hint.