Berkeley DB Reference Version 5.3.33

Chapter 4. Concurrency

Table of Contents

Which DB Handles are Free-Threaded

Locks, Blocks, and Deadlocks

Locks

Blocks

Deadlocks

The Locking Subsystem

Configuring the Locking Subsystem

Configuring Deadlock Detection

Resolving Deadlocks

Setting Transaction Priorities

Isolation

Supported Degrees of Isolation

Reading Uncommitted Data

Committed Reads

Using Snapshot Isolation

Transactional Cursors and Concurrent Applications

Using Cursors with Uncommitted Data

Exclusive Database Handles

Read/Modify/Write

No Wait on Blocks

Reverse BTree Splits

DB offers a great deal of support for multi-threaded and multi-process applications even when transactions are not in use. Many of DB's handles are thread-safe, or can be made thread-safe by providing the appropriate flag at handle creation time, and DB provides a flexible locking subsystem for managing databases in a concurrent application. Further, DB provides a robust mechanism for detecting and responding to deadlocks . All of these concepts are explored in this chapter.

Before continuing, it is useful to define a few terms that will appear throughout this chapter:

Which DB Handles are Free-Threaded

The following describes to what extent and under what conditions individual handles are free-threaded.