diff options
author | Evgeny Kotkov <kotkov@apache.org> | 2017-07-11 19:16:49 +0200 |
---|---|---|
committer | Evgeny Kotkov <kotkov@apache.org> | 2017-07-11 19:16:49 +0200 |
commit | 73b0441e089d60ef3942119b3ed1adc3f80c81bd (patch) | |
tree | 51f3f84d2576f9367d249dee67828e1b9dc6e66f /server/mpm/winnt | |
parent | mpm_winnt: Simplify the shutdown code that was waiting for multiple worker (diff) | |
download | apache2-73b0441e089d60ef3942119b3ed1adc3f80c81bd.tar.xz apache2-73b0441e089d60ef3942119b3ed1adc3f80c81bd.zip |
mpm_winnt: Remove an unnecessary Sleep() in the winnt_accept() function.
This sleep occured in a situation when:
- We don't have a free completion context in the queue
- We can't add one, as doing so would exceed the max_num_completion_contexts
limit (all worker threads are busy)
- We have exceeded a 1 second timeout while waiting for it
In this case, the Sleep() call is unnecessary, as there is no intermittent
failure that can be waited out, but rather than that, it's an ordinary
situation with all workers being busy. Presumably, calling Sleep() here
can be even considered harmful, as it affects the fairness between the
listeners that are blocked waiting for the completion context.
So, instead of calling Sleep() just check for the possible shutdown and
immediately retry acquiring a completion context. If all worker threads
are still busy, the retry will block in the same WaitForSingleObject() call,
which is fine.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1801639 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm/winnt')
-rw-r--r-- | server/mpm/winnt/child.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 7cbaf81f4f..2a336d75c0 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -439,7 +439,6 @@ reinit: /* target of connect upon too many AcceptEx failures */ if (!context) { rv = mpm_get_completion_context(&context); if (APR_STATUS_IS_TIMEUP(rv)) { - Sleep(100); continue; } else if (rv) { |