DB2 CLI supports concurrent execution of threads on AIX, OS/2, Windows 95, and Windows NT. On any other platform that supports threads, DB2 CLI is guaranteed to be thread safe by serializing all calls to DB2 CLI. In other words, DB2 CLI is always reentrant.
Note: | If you are writing applications that use DB2 CLI calls and either embedded SQL or DB2 API calls, see "Multi-Threaded Mixed Applications". |
Concurrent execution means that two threads can run independently of each other (on a multi-processor machine they may run simultaneously). For example, an application could implement a database-to-database copy in the following way:
In contrast, if DB2 CLI serializes all function calls, only one thread may be executing a DB2 CLI function at a time. All other threads would have to wait until the current thread is done before it would get a chance to execute.