cjrancur

STA Threads in ACE applications

Discussion created by cjrancur on May 12, 2010
Latest reply on May 13, 2010 by spilon

I have an ACE application that is clock scheduled at 1 minute intervals.  The module initiation routine starts a STA thread, and the module termination routine aborts the STA thread.  At the end of the processing tasks, I am forcing garbage collection.

 

In the ACE debugger, after the processing tasks have finished, if I leave the debugger running (the command window open) for a few minutes, then after a while I receive a context switch deadlock message that mentions that a STA thread should have messages pumped routinely. 

 

Would this happen outside of the debugger?  Say this was clock scheduled for 10 minute intervals.  Is there clean up done automatically by ACE when processing is done?  Is module termination called at the end of processing at each clock schedule, and module initiation called at the beginning of the clock schedule each time?  If so, I think I could safely close the STA thread when processing tasks have been completed, because it will be reopened if the module initiation routine is called at the beginning of each clock schedule.  If the module initiation routine is not called at the beginning of each STA schedule, should I open my STA thread elsewhere, not in the module initiation routine?

Outcomes