httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject File handle caching
Date Tue, 09 Jan 2001 22:06:16 GMT
When you cache a file handle on *nix, are file pointers maintained per process
or per thread? I thought they were maintained per process which would mean
that file handle caching is broken on *nix since there could easily be a race
condition between calling apr_seek and sendfile.

On Windows, I open cached files for async i/o which effectively gets rid of
the notion of a file pointer. The TransmitFile call must explicitly set the
'begin sending from here' pointer and an 'amount to send'  field (in the
OVERLAPPED structure).  This is also broken on Windows now (with the addition
of filters) since there is no guarantee that a cached file will be sent with
TransmitFile. This means that all Windows file i/o must be able to work
correctly with a file opened for async i/o.  I don't think it will be terribly
difficult to make changes to APR to do async file i/o under the covers but
give the appearance of either synchronous or non-blocking to the APR
application.

Just thinking out loud before I jump back into Apache... Comments welcome :-)

Bill



Mime
View raw message