httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: Fwd: file bucket native operations
Date Mon, 27 Nov 2000 16:53:02 GMT

> So I guess I'm asking two questions here:
> (1) Does anybody have any bright ideas that would help in implementing split() and
> a future copy() on file buckets, given the problems in reading non-sequentially
> from the file?

Native file splits are a bit annoying, but not impossible.  The easiest
way to deal with them, is to put an apr_lock_t inside the file type.  As
long as the ref count is 1, that lock should be NULL.  As soon as the
refcount is > 1 the lock needs to be created and used.  The buckets read
code already does the seek when necessary, so that shouldn't be an
issue.  As far as dealing with the limitations of having two buckets refer
to the same file, and using dup to handle this, I wouldn't worry about
that issue.

There are only a few cases we really need to worry about.

1)  The same file is opened in multiple threads of the same process.  This
is done with two calls to open, so it is a non-issue for us.

2)  We have one file that is split into two buckets.  This is handled with
the lock discussed above.

3)  We dup a file and it shows up in two buckets.  This isn't case we need
to worry about, because it can be treated as if we were just dealing with
files instead of buckets.

I don't think I missed any cases, but please let me know if I did.

> (2) Is there still an interest in adding a copy operation to the buckets API?

This is an absolute necessity.

Ryan

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/




_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------




Mime
View raw message