From Volker's patch I've submitted to master: ------------------------------------------------------- Using the new msg_source program with 1.500 instances against a single msg_sink I found the msg_source process to spawn two worker threads for synchronously sending the data towards the receiving socket. This should not happen: Per destination node we only create one queue. We strictly only add pthreadpool jobs one after the other, so a single helper thread should be perfectly sufficient. It turned out that under heavy overload the main sending thread was scheduled before the thread that just had finished its send() job. So the helper thread was not able to increment the pool->num_idle variable indicating that we don't have to create a new thread when the new job is added. This patch moves the signalling write under the mutex. This means that indicating readiness via the pipe and the pool->num_idle variable happen both under the same mutex lock and thus are atomic. No superfluous threads anymore. ------------------------------------------------------- Patch for 4.1.next and 4.0.next to follow once it hits master.
Created attachment 10226 [details] git-am fix for 4.1.next and 4.0.next. Back-port of Volker's fix that went into master.
Comment on attachment 10226 [details] git-am fix for 4.1.next and 4.0.next. Someone please review this... :-).
Re-assigning to Karolin for inclusion in 4.1.next, 4.0.next.
Pushed to autobuild-v4-[0|1]-test.
Pushed to both branches. Closing out bug report. Thanks!