diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-08-25 13:24:02 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-08-26 19:53:09 +0200 |
commit | da42780223bae35d38b6d4d920caa1563e884470 (patch) | |
tree | 3fc509250d09159e53d08b34b96bf83f71455dbb /docs/src | |
parent | 137d6af70aa4ef79cf1bb79348d748e654ed80dc (diff) | |
download | libuv-da42780223bae35d38b6d4d920caa1563e884470.tar.gz libuv-da42780223bae35d38b6d4d920caa1563e884470.zip |
threadpool: fix thread starvation bug
Commit 0f1bdb6 ("threadpool: send signal only when queue is empty")
introduces a regression where work is not evenly distributed across
the thread pool because the work queue's condition variable is only
signalled when the queue is empty, even when there are waiting workers.
It doesn't turn into outright deadlock because there is always
at least one thread making forward progress but it does degrade
throughput, sometimes massively so.
Signalling whenever there are waiting workers fixes the throughput
issue while still keeping the number of uv_cond_signal() calls low,
which was the motivation for commit 0f1bdb6.
Fixes: https://github.com/libuv/libuv/pull/490
Fixes: https://github.com/libuv/libuv/issues/492
PR-URL: https://github.com/libuv/libuv/pull/493
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
0 files changed, 0 insertions, 0 deletions