]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mpm_winnt: Make the shutdown faster by avoiding unnecessary Sleep()'s
authorEvgeny Kotkov <kotkov@apache.org>
Tue, 11 Jul 2017 16:41:51 +0000 (16:41 +0000)
committerEvgeny Kotkov <kotkov@apache.org>
Tue, 11 Jul 2017 16:41:51 +0000 (16:41 +0000)
commit180026b4f4605facb3e46e56aa31e9e088a02631
tree7f6d0e40260256804ee11afb53fedb42a153cf8b
parentde15a34dc8950c65d4e7d50119d2be1364b57a60
mpm_winnt: Make the shutdown faster by avoiding unnecessary Sleep()'s
when shutting down the worker threads.

Previously, the shutdown code was posting an amount of I/O completion
packets equal to the amount of the threads blocked on the I/O completion
port.  Then it would Sleep() until all these threads "acknowledge" the
completion packets by decrementing the global amount of blocked threads.

A better way would be to send the number of IOCP_SHUTDOWN completion
packets equal to the total amount of threads and immediately proceed to
the next step.  There is no need to block until the threads actually receive
the completion, as the shutdown process includes a separate step that waits
until the threads exit, and the new approach avoids an unnecessary delay.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1801635 13f79535-47bb-0310-9956-ffa450edef68
server/mpm/winnt/child.c