Here is a slide from System Programming course I'm currently taking:
catch_child
is SIGCHLD
handler. How does the output correspond to the code? Why are some "Child #x started" messages not printed?
Here is a slide from System Programming course I'm currently taking:
catch_child
is SIGCHLD
handler. How does the output correspond to the code? Why are some "Child #x started" messages not printed?
By definition, deadlock is a situation when no progress is made.
So it is not that some printf
messages are not printed/ignored, but that after some particular printf
call the program is waiting for something that will never happen and it keeps waiting there forever.
For more info about what causes such behavior see: Why are malloc() and printf() said as non-reentrant?