Go to the source code of this file.
This module contains functions for process control and control statistics. The process control operates on an array of processes, which is assigned by process_control_init().
The process control is designed to run as a pth thread. The thread, process_control_update_thread(), gathers process and CPU information from the system, and then checks if processes are in their required states and stops or restarts processes if necessary.
|
Acquire a mutex for process control. Before a process control function is called from an external module, it is necessary to lock the process control. If one thread acquires a mutex, it is locked by this thread and must be released to let other processes access. The correct handling of locking/unlocking the process control is left to the client. Process control functions do not lock or unlock resources internally.
|
|
Emergency exit. Sends terminate and kill signals to all controlled processes. |
|
Initializes the process control.
|
|
Notifies the termination of a process. When a process terminates, its parent process receives a CHILD signal. The signal handler calls this function to tell the process control that a process has terminated. |
|
Print a process list to a file descriptor.
|
|
Prints statistics output to a file descriptor, using pth_write.
|
|
Resets the process statistics of a list of processes.
|
|
Stops all processes in reverse starting order. Stops all processes in the process array. Sends a TERM signal, waits for the process to stop, possibly sends a KILL signal after the process's term_duration. |
|
Stops processes in reverse starting order.
|
|
Starts all processes.
|
|
Starts a list of processes identified by their tags.
|
|
Stops all processes. Stops all processes in the process array. |
|
Process information update thread. Calls process_control_update() periodically. |