So, I have a scheduler in c that sends another c program to execute every second. Then gets switch out for another program for a second in round robin style using a queue. However, I can change the amount of time the scheduler executes each process. For example, the first process could be 2 seconds of execution but the second could be 1 second (doubles depending on some condition).
So, when a process finishes it sends a signal to the scheduler which is then handled by sigaction. However, when a process finishes earlier then other like in the example above or whenever a process finishes ever. The scheduler stops inside the handler but when I use the kill command with the SIGCONT, the scheduler continues.
void handle(int sig){
globalVar = '\0';
}
int main (int argc, char *argv[]){
struct sigaction W;
W.sa_handler = &handle;
W.sa_flags = SA_RESTART;
sigaction(SIGRTMIN, &W, NULL);
}
The program should place '\0' in the queue and keep executing the remaining processes. Until, they all finish.