Counting deliveries rather than generations

A single-threaded Linux process has returning handlers installed for the standard signals SIGUSR1 and SIGUSR2, with neither signal initially pending. It blocks both signals, receives 9 generations of SIGUSR1 and 4 of SIGUSR2, then unblocks both and allows every pending handler to finish. It next blocks only SIGUSR1, receives 6 more generations of that signal, then unblocks it and again allows delivery to finish. Each batch finishes entirely while its relevant signals are blocked. The handlers neither generate signals nor change dispositions, and no other signals occur. How many handler invocations occur in total? Answer in invocations, as an integer.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Signal Handling Questions: