Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 35636 invoked by uid 500); 8 Feb 2002 22:13:41 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 35623 invoked from network); 8 Feb 2002 22:13:41 -0000 Message-ID: <013d01c1b0ee$275ee500$05000100@sashimi> From: "Bill Stoddard" To: References: <20020208193703.86472.qmail@icarus.apache.org> Subject: Re: cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c Date: Fri, 8 Feb 2002 17:15:44 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The important thing here is that the process yields to allow the child to initialize. The time of the sleep is really not important. The thing that needs to happen is deep in the OS, so I am not sure what we would mutex against. Yea, this does suck... it is a bug in the OS AFAIK cause we shouldn;t have to jump through these hoops. Bill > wrowe 02/02/08 11:37:03 > > Modified: server/mpm/winnt mpm_winnt.c > Log: > Drawing attention to the timing problem; push the wait up so we do about > nothing until WinNT initializes the app. > > Revision Changes Path > 1.229 +10 -10 httpd-2.0/server/mpm/winnt/mpm_winnt.c > > Index: mpm_winnt.c > =================================================================== > RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v > retrieving revision 1.228 > retrieving revision 1.229 > diff -u -r1.228 -r1.229 > --- mpm_winnt.c 6 Feb 2002 21:09:26 -0000 1.228 > +++ mpm_winnt.c 8 Feb 2002 19:37:02 -0000 1.229 > @@ -1585,6 +1585,16 @@ > NULL, > &si, &pi); > > + /* Important: > + * Give the child process a chance to run before dup'ing the sockets. > + * We have already set the listening sockets noninheritable, but if > + * WSADuplicateSocket runs before the child process initializes > + * the listeners will be inherited anyway. > + * > + * XXX: This is badness; needs some mutex interlocking > + */ > + Sleep(1000); > + > /* Undo everything we created for the child only > */ > CloseHandle(pi.hThread); > @@ -1605,16 +1615,6 @@ > > ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, ap_server_conf, > "Parent: Created child process %d", pi.dwProcessId); > - > - /* Important: > - * Give the child process a chance to run before dup'ing the sockets. > - * We have already set the listening sockets noninheritable, but if > - * WSADuplicateSocket runs before the child process initializes > - * the listeners will be inherited anyway. > - * > - * XXX: This is badness; needs some mutex interlocking > - */ > - Sleep(1000); > > if (send_handles_to_child(p, *child_exit_event, pi.hProcess, hPipeWrite)) { > CloseHandle(hPipeWrite); > > > >