httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilt, Paul" <pw...@xanedu.com>
Subject RE: MPM re-write for network logic
Date Tue, 13 Nov 2001 21:33:02 GMT
Bill:

Any chance that you would share that detailed walkthrough with the
rest of us people?

Paul E Wilt 
Principal Software Engineer
__________________________________________________________________
XanEdu, Inc. (division of Proquest Information and Learning)
http://www.xanedu.com  mailto:pwilt@XanEdu.com 
300 North Zeeb Rd      Phone: (734) 302-6545  (800) 218-5971 x6545
Ann Arbor, MI 48106    Fax:   (734) 975-6440
__________________________________________________________________



-----Original Message-----
From: Bill Stoddard [mailto:bill@wstoddard.com] 
Sent: Monday, November 12, 2001 11:18 PM
To: dev@httpd.apache.org; rbb@covalent.net
Subject: Re: MPM re-write for network logic



> On Monday 12 November 2001 07:22 pm, William A. Rowe, Jr. wrote:
> > From: "Ryan Bloom" <rbb@covalent.net>
> > Sent: Monday, November 12, 2001 8:55 PM
> >
> > > The problem that remains is Windows.  Windows starts the server, and
> > > creates one thread for each socket that is configured.  That thread
sits
> > > in accept, and passes the accepted socket to worker threads.  This
seems
> > > like a waste of resources, but I will accept that the Windows experts
> > > know what they are doing. My problem is that it doesn't really fit the
> > > model above. I guess that Windows could work by using the first hook
> > > above, and then looping through the apr_pollfd_t, creating threads
that
> > > call the third hook above.
> >
> > Uh... no, that's AcceptEx, and it has entirely different mechanics.
There
> > will always be data to process when a winsock has accept-ex-ed a socket
> > (thus the different API.)  Ergo, no thread is woken until it has a job
to
> > do.
>
> I have a stupid question.  I have been looking at the Windows code, and I
> can't see where the data that is read by AcceptEx ever gets to the
processing
> thread.  Does that data ever get to the thread doing the work?  If so,
how????
>

See PostQueuedCompletionStatus() and GetQueuedCompletionStatus().

The worker thread pool blocks on GetQueuedCompletionStatus() in
winnt_get_connection().
winnt_accept() accepts connections and calls PostQueuedCompletionSTatus() to
wake up one
of the workers blocked on GetQueuedCompletionStatus().

Notice the queue of 'completion contexts' that flow between the two calls.
And the
ThreadDispatchIOCP is a Windows "Completion Port" a kernel resident FIFO
queue of sorts.

Give me a call tomorrow and I'll walk you through it in detail if you like.

Bill

> Ryan
> ______________________________________________________________
> Ryan Bloom rbb@apache.org
> Covalent Technologies rbb@covalent.net
> --------------------------------------------------------------
>

Mime
View raw message