httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject RE: Should ap_bread et. al. be modified to work with async i/o APIs?
Date Wed, 12 Apr 2000 18:17:58 GMT
> From: Bill Stoddard []
> Sent: Wednesday, April 12, 2000 10:00 AM
> The anonymous pipes Windows uses to talk to CGI scripts are
> always blocking
> (and cannot be set non-blocking). I'm trying to fix this in
> Apache 2.0 and
> have gotten bogged down in uglyness.

Bill, once we have the anon (unnamed) NT pipe, we can use the
handle to change the PIPE_NOWAIT.  To quote Jan00 PSDK...

BOOL SetNamedPipeHandleState(
  HANDLE hNamedPipe,             // handle to named pipe
  LPDWORD lpMode,                // new pipe mode
  LPDWORD lpMaxCollectionCount,  // maximum collection count
  LPDWORD lpCollectDataTimeout   // time-out value

hNamedPipe [...]
Windows NT/2000: This parameter can also be a handle to an anonymous pipe,
as returned by the CreatePipe function.

Have you tested this?  Which end of the anon pipe did you try to toggle?

> There is yet another solution; use the PIPE_NOWAIT function
> in named pipes
> and maintain the non-blocking symantics.  I'm not sure if MS
> discourages
> this or not. The doc says PIPE_NOWAIT should not be used to
> implement async
> i/o. Well duh, non-blocking and async are different beasts. I
> don't think
> that's what they really ment though (I intuit this from the
> other doc in
> MSDN).

Again, quoting...

Note that nonblocking mode is supported for compatibility with Microsoft®
LAN Manager version 2.0 and should not be used to achieve asynchronous input
and output (I/O) with named pipes

Let's use it and get on with it.  Is there a better way?  Probably.  Do we
want to launch 2.0?  Yes.  Soon.  The argument here is for the LM way, which
more closely resembles traditional unix, or MS's propritary new-fangled way.
It's not likely that it will be a clean fit into the apr methodology.

Someday, pre-2.1, someone will step up and offer the patch to 'do it right'
with the performance analysis to prove it.  In the meantime, if it is stable
and effective, let's move forward.

I've been watching the 'Bill Stoddard is/will...' list grow monthly.  Do you
care to post the "I'm doing this now, am almost finished, contributors may
as well choose another area to work on", vs. the "I'll get to these if
someone doesn't beat me to it first" list?  Kudos to all the areas you are
tackling, but let a few others help you unwind this list.

View raw message