Monday, August 24, 2009

USE_BLOCKING_THREAD

Another interesting email conversation between a developer and Dimitry Yemanov (Firebird core developer) produced this information:

Q.
What is the intent for the USE_BLOCKING_THREAD? I see it is enabled for all configurations except superserver. What is the rationale for that?

A.
The blocking thread (sometimes referred to as the AST delivery thread) listens for the blocking event notification posted by other processes and calls an appropriate BAST (blocking AST) routine inside the local process. This is necessary to asynchronously release or downgrade locks acquired by the current process but requested by other processes and is a vital part of the lock manager.

SuperServer doesn't need this feature as it performs direct AST calls from the lock requester to the lock holder (as everybody lives inside a single process).

The v2.5 embedded engine allows both in-process and cross-process interaction, thus it has the blocking thread enabled. For a single process embedded engine, USE_BLOCKING_THREAD may be undefined.

No comments: