StateServer 1.6.9
Compiled `c` application to handle task state logging and timing.
|
Single global mutex lock guard and thread condition signals. More...
Variables | |
pthread_mutex_t | mutex |
Only mutex. Manages thread concurrency and synchronization together with condition signals. | |
pthread_cond_t | wake_controller_handler |
Condition signal issued by the clock handler thread to wake the controller handler thread. | |
pthread_cond_t | wake_input_handler |
Condition signal issued by the controller handler thread to wake the input handler thread. | |
pthread_cond_t | wake_state_handler |
Condition signal issued by the input handler thread to wake the state handler thread. | |
pthread_cond_t | wake_output_handler |
Condition signal issued by state handler thread to wake the output handler thread. | |
pthread_cond_t | wake_clock_handler |
Condition signal issued by the output handler thread to wake the clock handler thread. | |
Single global mutex lock guard and thread condition signals.
There is a single global mutex to ensure concurrency and synchronization on the 5 main handler threads.
Together with the volatile global sig_atomic_t flags (which ensure atomicity in the compiler), the thread management is ensured to always complete the following cycle:
CLOCK --> CONTROLLER --> INPUT --> STATE --> OUTPUT
Any function that uses print debug while server is running (i.e. printf("my debug statement");
) should ensure that prior to printf
, it has acquired mutex via pthread_mutex_lock(&mutex);
, and releases the lock after via pthread_mutex_unlock(&mutex);
. This ensures the debug print statements do not alter the behavior of the state server by accessing the terminal stdio in a non-thread-safe manner.
|
extern |
Only mutex. Manages thread concurrency and synchronization together with condition signals.
Only mutex. Manages thread concurrency and synchronization together with condition signals. >
|
extern |
Condition signal issued by the output handler thread to wake the clock handler thread.
Condition signal issued by output handler thread to wake clock handler thread. >
|
extern |
Condition signal issued by the clock handler thread to wake the controller handler thread.
Condition signal issued by clock handler thread to wake controller handler thread. >
|
extern |
Condition signal issued by the controller handler thread to wake the input handler thread.
Condition signal issued by controller handler thread to wake input handler thread. >
|
extern |
Condition signal issued by state handler thread to wake the output handler thread.
Condition signal issued by state handler thread to wake output handler thread. >
|
extern |
Condition signal issued by the input handler thread to wake the state handler thread.
Condition signal issued by input handler thread to wake state handler thread. >