apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: apr-util/buckets apr_buckets_file.c
Date Thu, 05 Jul 2001 15:01:22 GMT
On Thu, 5 Jul 2001, Bill Stoddard wrote:

> > You can't guarantee that consecutive reads from file buckets read from the
> > "next" spot in the file.  In fact, they very frequently jump around.
>
> Give me a common example of reads from file buckets jumping around.

The chunk filter.  Or any filter for that matter.  Any time
apr_bucket_split() or apr_bucket_copy() [or even apr_bucket_delete()] are
used.

I've been trying to think of *any* possible way that the buckets code
could know whether the file pointer is at the "right spot" or not.
Possibly some kind of flag in the apr_bucket_file that indicates whether
any of the above operations have been called.  But no matter what approach
I come up with, I always come up with cases where it just won't work.

If you're really desperate to optimize the case where we read straight
through the file [and can't use sendfile and can't use mmap], I think the
best way to do it is to put another conditional in apr_file_seek that
checks to see if the file handle is already at the right place and if so
returns immediately, skipping the call to lseek() or whatever.  But
lseek() is probably doing the same thing anyhow...

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message