-
Notifications
You must be signed in to change notification settings - Fork 311
Running the stack in a multithreaded mode
Scott Godin edited this page Apr 18, 2021
·
1 revision
The stack The can run in a separate thread from the TU (or application), via the StackThread, InterruptableStackThread or EventStackThread classes. See StackThread vs InterriptableStackThread.
As well, the stack can be decomposed into multiple threads using the following method calls on SipStack.hxx. These calls are used on top of the above stack thread processing:
- SipStack::run: Causes this SipStack object to create and run threads for carrying out processing. This includes a thread for DNS lookups, a thread for transaction processing, and a thread for transport processing (individual Transport objects may be registered as having their own thread; these are not serviced by the thread spawned by this call). This function is intended to be used in addition to the normal methods of giving the SipStack cycles (eg; EventStackThread, StackThread, etc); these are still necessary to give the SipStack cycles for handling application timers, statistics logging, and shutdown logic.
- SipStack::shutdown: Perform orderly shutdown. Inform the transaction state machine processor that it should not create any new transactions and to perform an orderly shutdown. When the transactions are all terminated, return a ShutdownMessage to the TU. Note: If the SipStack is running in multithreaded mode, this function DOES NOT shut down the threads. This is what shutdownAndJoinThreads() is for. (Shutting down threads in this call would prevent orderly shutdown from working; outstanding transactions would be dropped on the floor)
- SipStack::shutdownAndJoinThreads: Shutdown and join any threads that the SipStack is running.
- Navigation
- Developers
- Packages
- Community