![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Terminating a thread Topic Summary: Created On: 25-May-2007 15:33 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I need to perform a graceful shutdown of all the tasks and threads within Rhapsody. I used the OMThread::stopAllThreads(NULL) and invoked this function from a separate task (called the shutdown task).
All the tasks seem to go down gracefully, but the Timer thread seems to be still running. Any ideas on how to terminate this? There are couple of active classes which make use of a timer. Appreciate any help.. Rianto |
|
![]() |
|
![]() |
|
This is not a straight forward thing... a full shutdown of the framework is not really planned, since embedded applications typically never end.
The framework creates four Singleton objects (OMMainThread, OMThreadManager, OMTimerManager, [RTOS]OSFactory) and a TimerHeap during startup in OXF::initialize(). These act as global services, available to any dynamically created object, trying to use the OXF services at any time. Removing those is not that easy on all OSes. If you run the framework as a process in a heavy weight process based OS (like Unix, Linux, Windows, etc.) then the OS will do the final memory cleanup during exit(). For small thread based OSes this is manual work. Switching such a system off is the preferred way... You may want to have a look into the OS specific implementations of OMOS::endApplication() in various OSALs. These get shipped with the product, e.g. compare VxWorks vs. Linux implementation - a big difference. Hope that helps. |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Terminating a thread
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.