Mixed multithreaded CLI applications

When you use CLI, it is possible for a multithreaded application to mix CLI calls with Db2® API calls and embedded SQL. However, the application must explicitly manage all contexts. This means that any thread that calls a Db2 API or embedded SQL function or CLI must be attached to a context explicitly by calling Db2 context APIs.
Note: It is recommended that you do not use the default application stack size, but instead increase the stack size to at least 256 000. Db2 requires a minimum application stack size of 256 000 when calling a Db2 function. You must ensure therefore, that you allocate a total stack size that is large enough for both your application and the minimum requirements for a Db2 function call.