The following basic steps are necessary to dequeue messages:
Initialize SDK resources and data structures with mtaInit().
Call mtaDequeueStart(), passing it the address of the caller-supplied routine that is to be used to process each message.
When mtaDequeueStart() is called, it does not return until all queued messages requiring processing have been processed, thus blocking the thread calling it until it is finished.
For each queued message requiring processing, an execution thread created by mtaDequeueStart() calls the routine whose address was provided in Step 2.
Threads created by mtaDequeueStart() each sequentially process multiple messages. That is, mtaDequeueStart() does not create a distinct thread for each and every queued message to be processed.
For a list of the tasks the processing routine should do, see Caller-Supplied Processing Routine.
The mtaDequeueStart() routine will use one or more threads, with each thread calling the message processing routine. The maximum number of threads allowed can be set when calling mtaDequeueStart(). Consequently, a program that does not support threading should specify a maximum of one thread when it calls mtaDequeueStart.
For a list of the tasks the processing routine should do, see Dequeue Message Processing Routine Tasks.
After mtaDequeueStart() returns, deallocate SDK resources and data structures with a call to mtaDone().