Products | Versions |
---|---|
Not Applicable | - |
Resolution:
TIB/ObjectBus programs can be single- or multi-threaded. Starting a program creates a main thread of execution, and unless the program explicitly creates subsequent threads, it will run entirely in the main thread, in single-threaded mode.
<br>You can also create a pool of threads that share a common event queue, and this allows you to redirect events from the thread that opened the asynchronous interaction to the queue that feeds the pool event-handling threads. <br>This allows several threads to use the event-handling code simultaneously, which improves the processing of the invocations or callbacks. <br>Creating this thread pool simply requires the addition of 2 function calls to your code.<br>In an example of this, a server program could create and run an implementation object in its main thread, but redirect the invocation events from the main thread to a pool of event-handling threads. <br>These threads would share access to the implementation object, and improve the processing of invocations on it. <br>The main thread could carry out other tasks while the pooled threads handled the events.