Overview of Firebird Client Library Thread-Safety

Last updated 2005.11.20 20:21 EST

Purpose of this Document

The thread-safety properties of the standard Firebird client library vary according to the following:

Determining whether the client library you're using is thread-safe can be quite confusing. This document aims to reduce that confusion by defining what thread-safety means in the context of the Firebird client library, then presenting a table that specifies which client library configurations are thread-safe.

Note that this document deals only with the standard Firebird client library that underlies the Firebird C API. It has no relevance to the clean-slate reimplementations in access libraries such as Jaybird.

Definition of "Thread-Safety"

Currently, the highest level of concurrency supported by any version of the Firebird client library is "thread-safety at the connection level".

When we say that the Firebird client library is "thread-safe at the connection level", we mean that it is safe to use a particular connection in only one thread at a time, although the same connection can be manipulated by different threads in a serial fashion, and different connections can be manipulated by different threads in parallel.

For example, in a multithreaded application server, it is safe for a particular connection to be leased from a connection pool by Thread A, used, and returned to the pool for later lease by Thread B. It is not safe for Thread A and Thread B to use the same connection at the same time.

Thread-Safety Table

FB VersionOSFB ArchitectureRemote Or LocalThread-Safe?
 
1.0.3WindowsSuperServerLocalN
   RemoteY
  ClassicLocal[No such config.]
   Remote[No such config.]
  EmbeddedLocal[No such config.]
   Remote[No such config.]
 LinuxSuperServerLocal[No such config.]
   RemoteN
  ClassicLocalN
   RemoteN
 
1.5.3WindowsSuperServerLocalN
   RemoteY
  ClassicLocal[No such config.]
   RemoteY
  EmbeddedLocalY
   Remote[No such config.]
 LinuxSuperServerLocal[No such config.]
   RemoteY
  ClassicLocalN
   RemoteN
 
2.0.0WindowsSuperServerLocalY
   RemoteY
  ClassicLocalY
   RemoteY
  EmbeddedLocalY
   Remote[No such config.]
 LinuxSuperServerLocal[No such config.]
   RemoteY
  ClassicLocalN
   RemoteN
 
VulcanWindowsN/ALocalY
  N/ARemoteY
 LinuxN/ALocalY
  N/ARemoteY

This document was written by David Rushby, with assistance from Dmitry Yemanov. Errors are attributable to Rushby rather than Yemanov, and should be reported by e-mail to woodsplitter@rocketmail.com.