Firebird Documentation IndexFirebird Vulcan Release Notes v. 1.1 → Symmetric Multiple Processors (SMP)
Firebird Home Firebird Home Prev: Getting StartedFirebird Documentation IndexUp: Firebird Vulcan Release Notes v. 1.1Next: Compatibility and Portability

Symmetric Multiple Processors (SMP)

Table of Contents

Overview of SMP

Overview of SMP

In Firebird Vulcan, threads run in parallel and are scheduled by the operating system thread scheduler. This algorithm works well on symmetric multi-processors, but requires a mechanism for protecting critical data structures from being modified by one thread while being read or modified by another thread.

Thread Synchronization

Firebird Vulcan threads run concurrently and are synchronized by controlling access to specific data structures and objects. Wherever possible, data structures and objects are changed from one consistent state to another by a single, non-interruptible instruction. When an object must be held in a consistent state for reading or writing, the accessing thread must acquire a lock.

Objects typically provide their own locks. Most objects use instances of a SyncObject class contained in their class definitions. Each SyncObject controls a specific part of the object. SyncObjects are implemented with system-specific non-interruptible instructions.

SyncObject

A SyncObject provides shared and exclusive locks with exclusive lock requests managed in a "fair" ordering. Shared locks allow multiple threads to read the values of an object instance. Exclusive locks allow one thread to change values in an object instance.

"Fair" ordering means that requests for a lock on an object are serviced in order. If the object is locked in shared mode with no lock requests pending and another request is received for that lock in shared mode, the second lock is granted. As soon as a thread requests an exclusive lock on the object, additional requests for shared locks queue behind the request for the exclusive lock.

Prev: Getting StartedFirebird Documentation IndexUp: Firebird Vulcan Release Notes v. 1.1Next: Compatibility and Portability
Firebird Documentation IndexFirebird Vulcan Release Notes v. 1.1 → Symmetric Multiple Processors (SMP)