System Calls: RT Process Control

System calls for RT process control fall into three categories
  • synchronizing the load/start/termination of the created process
  • Many applications require a coordinated start and need to know when the loaded process terminates. Use these calls in such situations.
  • forcing a process to end
  • The <ntx>TerminateRTProcess sends a DSM TERMINATE message to hProcess allowing it to perform any cleanup activities needed for graceful termination. The call waits mswait milliseconds and optionally forces a delete using <ntx>DeleteRTProcess if hProcess has not reacted.
  • A more rigid method to end the process is to directly call <ntx>DeleteRTProcess. hProcess will not get signaled thus does not get a chance for cleanup. All objects contained in hProcess get deleted. <ntx>DeleteRTProcess also will return borrowed resources and reset interrupt levels associated with interrupt threads owned by hProcess.
  • ExitRtProcess performs similar activities like <ntx>DeleteRTProcess but does NOT clear up any C library resources. Rather use the C library exit() call to exit an INtime process. exit() avoids possible memory leaks in the root process by cleaning up C library resources.
  • get/set process attributes (only for INtime API)
  • The default maximum priority for a thread in a new process is 129. Setting the max priority typically is used when interrupt threads are to execute in this process.
  • GetRtProcessPoolInfo gets all memory pool attributes including the size of the initial pool, borrowed memory and parent process handle. It can be used to diagnose issues with memory fragmentation. When the process’s memory requirement is clear, create the process with a pool big enough to avoid borrowing/fragmentation. Memory pool attributes are also printed by INtex, one of the INtime tools provided for diagnostics.