m4_comment([$Id: stdmode.so,v 10.26 2001/05/22 19:39:32 bostic Exp $]) m4_ref_title(Locking Subsystem, Standard lock modes, standard @lock modes, lock/max, lock/dead) m4_p([dnl The m4_db locking protocol is described by a conflict matrix. A conflict matrix is an NxN array in which N is the number of different lock modes supported, and the (i, j)th entry of the array indicates whether a lock of mode i conflicts with a lock of mode j. In addition, m4_db defines the type m4_arg(db_lockmode_t), which is the type of a lock mode within a conflict matrix.]) m4_p([dnl The following is an example of a conflict matrix. The actual conflict matrix used by m4_db to support the underlying access methods is more complicated, but this matrix shows the lock mode relationships available to applications using the m4_db Locking subsystem interfaces directly.]) m4_tagbegin m4_tag(DB_LOCK_NG, [not granted (always 0)]) m4_tagns(DB_LOCK_READ, [read (shared)]) m4_tagns(DB_LOCK_WRITE, [write (exclusive)]) m4_tagns(DB_LOCK_IWRITE, [intention to write (shared)]) m4_tagns(DB_LOCK_IREAD, [intention to read (shared)]) m4_tagns(DB_LOCK_IWR, [intention to read and write (shared)]) m4_tagend m4_p([dnl In a conflict matrix, the rows indicate the lock that is held, and the columns indicate the lock that is requested. A 1 represents a conflict (that is, do not grant the lock if the indicated lock is held), and a 0 indicates that it is OK to grant the lock.]) m4_indent([dnl Notheld Read Write IWrite IRead IRW Notheld 0 0 0 0 0 0 Read* 0 0 1 1 0 1 Write** 0 1 1 1 1 1 Intent Write 0 1 1 0 0 0 Intent Read 0 0 1 0 0 0 Intent RW 0 1 1 0 0 0]) m4_tagbegin m4_tag(*, [dnl In this case, suppose that there is a read lock held on an object. A new request for a read lock would be granted, but a request for a write lock would not.]) m4_tag(**, [dnl In this case, suppose that there is a write lock held on an object. A new request for either a read or write lock would be denied.]) m4_tagend m4_page_footer