Record Locking Help ....
Kurt Wall
kwall
Sun Aug 14 22:01:29 PDT 2005
On Sun, Aug 14, 2005 at 10:38:02AM -0500, Ben Duncan took 19 lines to write:
> Anyone got any pointers, algorithms, bookmarks to, etc., on
> dealing with record locking in a multi user environment when writing
> a database/file manager system?
The two system calls that come to mind are fcntl() and flock().
There is also the distinction between advisory locks, which are
not enforced at the kernel level, and mandatory locks, which can
be enforced at the kernel level.
If you are trying to serialize access for mulitple concurrent users,
the usual approach is to use semaphores, which can be shared among
multiple processes (perhaps by declaring the semaphore in a shared
header file).
Kurt
--
If a 6600 used paper tape instead of core memory, it would use up tape
at about 30 miles/second.
-- Grishman, Assembly Language Programming
More information about the Linux-users
mailing list