Previous Topic

Next Topic

Single-threaded to Multi-Threaded

Switching to a multi-threaded, ctThrd, library is similar to adding transaction processing: superficially very easy, but with many implications.

As a minimum when using the ctThrd library, you must implement the ctThrd API. You must call ctThrdInit() before initializing c-tree Plus, just as you must initialize c‑tree Plus before calling any other c-tree Plus API functions.

Any new threads that call c-tree Plus API functions must be created with ctThrdCreate() or attached with ctThrdAttach().

In the Multi-threaded Standalone model, do not mix the c-tree Plus Instance API (RegisterCtree(), etc.) with the ctThrd API. Each thread is it’s own instance of c-tree Plus, and handles instance switching via the ctThrd functions. This is not an issue with the Multi-threaded Client Model.

See “ctThrd Function Overview for more detail.