Use fcntl. This replaces the Berkeley lockf.
Any OS which is POSIX compliant implements the fcntl style locks one way
or another.
Jay Sprenkle wrote:
Which call to the operating system (any operating system is fine) returns a
read lock?
I did locking, but it has been some time back, and there were only write
locks.
You could open a file in shared MODE or not, which write locked the
file, or
failed to write lock the file.
My understanding was that a "shared lock" is a metaphor, and IMHO, a fairly
stupid one.
If you lock a room, nobody else can get in, it's not a mechanism for
sharing, it's a mechanism for preventing sharing.
The absense of black does not imply white.
On 1/21/07, John Stanton <[EMAIL PROTECTED]> wrote:
POSIX defines read and write locks. A write lock is exclusive and a
read lock inhibits a write lock from occurring. Any number of
processes/threads can have a read lock but as long as one read lock is
in place a write lock cannot be established. When a write lock is set
no read or write locks can complete.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------