HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
42 HP-UX C SIP Stack Programmer’s Guide
Multithreading Modes
process it. The processing queue is used also in the no-thread and thread safety
modes. However, in these modes, it is the main thread that both inserts events
into the queue and then takes them out for further processing.
The following events are inserted to the processing queue:
Message received event—each received message is inserted
into the queue and will be processed by one of the processing
threads.
TCP events—read, write, connect and close.
Object termination events—all SIP Stack objects are terminated
in an a-synchronic manner using the processing queue.
Object states—states that the SIP Stack needs to handle in an a-
synchronic manner are inserted into the processing queue. For
example, the connection states and the MsgSendFailure state of
the transaction.
Timer expiration events
M
ANDATORY ACTIONS
FOR MULTITHREADED
A
PPLICATIONS
Multithreaded applications must ensure the following actions (modes 2 and 3):
The SIP Stack is constructed from the main thread. The
application must also destruct the SIP Stack from the main
thread.
RvSipStackProcessEvents() or any of the select() functions
must be called from the main thread.
The application must lock all application objects. Whenever a
callback is called, the application must immediately lock the
relevant application object before further processing. The
object should be unlocked before the callback returns.
The application should be prepared to handle events (callbacks)
that are received from different threads, including application
threads.
CONFIGURATION
P
ARAMETERS
The following configuration parameters are related to all the multithreading
modes of the SIP Stack:
numOfProcessingThreads
numOfReadBuffers
ProcessingQueueSize
For more information about multithreaded configuration parameters, see the
Configuration chapter.