INF: Using SQL Db-Lib Calls in Multithreaded ProgrammingID: Q66472
|
The DB-Library (DB-Lib) routines are basically non-reentrant; therefore, you are responsible for serializing the DB-Lib calls that access the named pipe connection in multithreaded applications you develop.
This is true when more than one thread accesses a single dbprocess; it
is necessary to serialize calls to the named pipe connection in an
application where more than one thread accesses a single dbprocess.
Also, if each thread accesses a different dbprocess, you are freed of
serialization concerns except for operations that involve global
variables. Error and message handling is maintained globally;
therefore, you might want to block on a semaphore when an error or
message occurs, so that you are not preempted by another thread. The
dbprocess passed to the error/message handler will distinguish which
thread is involved.
Timeouts are also managed globally.
Additional query words: dblib
Keywords : kbprg SSrvDB_Lib
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 10, 1999