NCBI C++ ToolKit
Public Attributes | List of all members
MDB_txbody Struct Reference

Search Toolkit Book for MDB_txbody

The header for the reader table. More...

+ Collaboration diagram for MDB_txbody:

Public Attributes

uint32_t mtb_magic
 Stamp identifying this as an LMDB file. More...
 
uint32_t mtb_format
 Format of this lock file. More...
 
mdb_mutex_t mtb_rmutex
 Mutex protecting access to this table. More...
 
volatile txnid_t mtb_txnid
 The ID of the last transaction committed to the database. More...
 
volatile unsigned mtb_numreaders
 The number of slots that have been used in the reader table. More...
 

Detailed Description

The header for the reader table.

The table resides in a memory-mapped file. (This is a different file than is used for the main database.)

For POSIX the actual mutexes reside in the shared memory of this mapped file. On Windows, mutexes are named objects allocated by the kernel; we store the mutex names in this mapped file so that other processes can grab them. This same approach is also used on MacOSX/Darwin (using named semaphores) since MacOSX doesn't support process-shared POSIX mutexes. For these cases where a named object is used, the object name is derived from a 64 bit FNV hash of the environment pathname. As such, naming collisions are extremely unlikely. If a collision occurs, the results are unpredictable.

Definition at line 728 of file mdb.c.

Member Data Documentation

◆ mtb_format

uint32_t MDB_txbody::mtb_format

Format of this lock file.

Must be set to MDB_LOCK_FORMAT.

Definition at line 733 of file mdb.c.

◆ mtb_magic

uint32_t MDB_txbody::mtb_magic

Stamp identifying this as an LMDB file.

It must be set to MDB_MAGIC.

Definition at line 731 of file mdb.c.

◆ mtb_numreaders

volatile unsigned MDB_txbody::mtb_numreaders

The number of slots that have been used in the reader table.

This always records the maximum count, it is not decremented when readers release their slots.

Definition at line 751 of file mdb.c.

◆ mtb_rmutex

mdb_mutex_t MDB_txbody::mtb_rmutex

Mutex protecting access to this table.

This is the reader table lock used with LOCK_MUTEX().

Definition at line 740 of file mdb.c.

◆ mtb_txnid

volatile txnid_t MDB_txbody::mtb_txnid

The ID of the last transaction committed to the database.

This is recorded here only for convenience; the value can always be determined by reading the main database meta pages.

Definition at line 746 of file mdb.c.


The documentation for this struct was generated from the following file:
Modified on Fri Sep 20 14:58:23 2024 by modify_doxy.py rev. 669887