-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monitor exiting on EOF #20
Comments
I believe it should not quit on EOF, but just stop, as if it's receiving SIGTSTP. Could be wrong, though. |
Our current monitor implementation does not handle any signals and, for what I understand, Exercise 5.pdf does not mention signal handling for monitor (besides sending SIGTSTP to the writer). |
What do you mean, stop? |
Euh… never mind, my mistake. |
This issue could be considered a bug because when stdin reaches EOF, sometimes monitor will call exit_monitor() even before writer_parallel starts running main(), so when it sends the SIGTSTP signal to writer_parallel it has not yet registered the signal handler, causing it to default to the default SIGTSTP behavior (which causes the process to suspend execution), effectively blocking the monitor. However, the workaround for #19 on 4181c33 prevents this from happening: with monitor sleeping, writer_parallel has plenty of time to register its signal handler(s). |
Running
proj-so/src$ ./monitor < ../inputs/1.in
, monitor quits (sending a signal to writer_parallel) even before the child process has time to callexecl("writer_parallel");
. After re-reading Exercise 5.pdf, I realized it does not mention that the monitor should quit on EOF, which we are currently doing. It is, however, silly not to quit on EOF, since then how would we receive the quit command (sair) from stdin? Perhaps it should run forever?The text was updated successfully, but these errors were encountered: