The help for setting the executable can be obtained by using the command:
DamState: gives the illumination state. If the state is 1, the packets are released; if the state is 0, the packets are stored. This variable can be viewed and modified by several threads, so it is protected by a mutex.
signalPktAdded: boolean that indicates at a given time t whether or not a signal mechanism should be used by the threads
process_read_send. This variable can be viewed and modified by several threads, so it is protected by a mutex.
scheduler: this thread manages the timeline defined by the program's input parameter. If the timeline indicates state 1, it sets the shared variable
damStateto 1 and sends a signal to
process_read_sendto inform it that packets can be released. Otherwise, it sets the
damStatevariable to 0. After this step, it waits until the time of the next ds expires.
process_rcv_write: this thread receives the packets from the socket and stores them in a FIFO queue. If the shared variable
signalPktAddedis 1, it sends a signal to
process_read_send to informit that a packet has just been added to the FIFO.
process_read_send: this thread waits until receiving a signal informing it that the packets can be released. When the signal is received, it empties the entire FIFO and sends the packets. It then waits to receive a signal informing it that a new packet has been stored, while checking that the packets can still be released. If it does, it sends the packet. Otherwise, it waits for the next signal informing it that the packets can be released.