The following is an example of a conflict matrix. The actual conflict matrix used by Berkeley DB to support the underlying access methods is more complicated, but this matrix shows the lock mode relationships available to applications using the Berkeley DB Locking subsystem interfaces directly.
DB_LOCK_NG
not granted (always 0)
DB_LOCK_READ
read (shared)
write (exclusive)
DB_LOCK_IWRITE
intention to write (shared)
DB_LOCK_IREAD
intention to read (shared)
intention to read and write (shared)
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.
*
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.
**