On Tue, 27 Nov 2001, Cliff Woolley wrote:
> Nope, scratch that, it won't even happen in that case. Duh. The
> split/copied file buckets point to the _same_ apr_bucket_file struct and
> therefore the _same_ apr_file_t. Only once will we ever see that
> apr_file_t as APR_XTHREAD, at which point we reopen it as ~APR_XTHREAD and
> replace the apr_file_t in the shared apr_bucket_file struct.
>
> You'll only ever possibly reopen the file once for one family of file
> buckets [which basically means once per request max].
ok, i see that now. as for mod_file_cache taking care of this, it too
would only reopen the file on every request if we have to, no?
after all, it is mod_file_cache that sets the XTHREAD flag to begin with.
just doesn't seem like bucket_read() is the right place for this logic.
main issue for me is, if the file cannot be mmapped, i want to avoid
apr_bucket_read()/file_read() and just call apr_file_read() directly for
better performance. i imagine other modules might want to do this as
well. wouldn't want to see copy-n-paste of the XTHREAD logic in these
cases.
|