You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Havard <br...@kheldar.apana.org.au> on 1999/03/26 09:56:57 UTC

APR: non-blocking file I/O?

I've been taking a look at the APR file-io API and saw

#define APR_NONBLOCK 256          /* Don't block when reading or writing */

Unless you're trying to implement user-land threads, is there any need for
non-blocking file I/O? I ask because OS/2 doesn't do it natively. Pipes and
sockets are ok but not actual disk files.

--
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: APR: non-blocking file I/O?

Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
Probably not.  This was left in the spec from back when we were thinking
of treating sockets and files as the same structure differentiated with a
flag.  This has since changed to two different structures, so we could
most likely take out the NON_BLOCKING flag.

I haven't done any work on APR recently, and I don't plan to until the
NSPR license is out, and the group can decide if we want to use NSPR or if
we want to write APR.  I don't think APR will take that long for an
initial drop, and then we can improve it after it is working.

If we decide to use APR, I'll remove the NONBLOCKING flag for regular disk
IO.

Ryan


On Fri, 26 Mar 1999, Brian Havard wrote:

> I've been taking a look at the APR file-io API and saw
> 
> #define APR_NONBLOCK 256          /* Don't block when reading or writing */
> 
> Unless you're trying to implement user-land threads, is there any need for
> non-blocking file I/O? I ask because OS/2 doesn't do it natively. Pipes and
> sockets are ok but not actual disk files.
> 
> --
>  ______________________________________________________________________________
>  |  Brian Havard                 |  "He is not the messiah!                   |
>  |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
>  ------------------------------------------------------------------------------
> 
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


Re: APR: non-blocking file I/O?

Posted by Dean Gaudet <dg...@arctic.org>.
On Fri, 26 Mar 1999, Brian Havard wrote:

> I've been taking a look at the APR file-io API and saw
> 
> #define APR_NONBLOCK 256          /* Don't block when reading or writing */
> 
> Unless you're trying to implement user-land threads, is there any need for
> non-blocking file I/O? I ask because OS/2 doesn't do it natively. Pipes and
> sockets are ok but not actual disk files.

Same as unix...  You can say O_NDELAY when you open() something, but if
it's a file it's a nop.  Some unixes provide aio (async i/o) ... and if
you've got real native threads you can simulate non-blocking disk i/o. 

At any rate, I think that's referring to sockets and pipes. 

Dean