> > Perhaps I don't have a good understanding of how to apply file locking. I 
> > want the following characteristics:
> > Readers always see consistent versions of all files
> > Many readers can see the files at the same time
> > A writer should get immediate priority
> 
> I think K can help here -- he seemed eager to help out on locking problems.  
> :)

I'm happy to help.

IIRC, RW locks don't provide the semantics that Brock described.  In
most cases, a writer has priority over readers, but must wait until all
readers have exited the critical section.

fcntl(2) locking allows you to either set shared or exclusive locks on
byte-ranges within a file.  This should allow you to emulate RWlock
semantics, but it's not a very fast interface.

Check out fcntl(2), lockf(3C), and Python's fcntl module's lockf():

        http://www.python.org/doc/2.4.4/lib/module-fcntl.html

I might be able to provide more useful information if I knew a bit more
about what problem we're trying to solve.  I did take a look at
consistent_open().

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to