0

The book "Advanced Programming in the Unix Environment" says:

The kernel do not queue signals unless they support the real-time extensions to POSIX.1

If a blocked signal is generated more than once(generated blocked signals are different type), it's set on the signal mask. Then, signals related to the current state of the process is delivered before other signals.

Here, is it different between signal queue and signal mask? If, signal mask is set for each different types, it means the kernel knows what signals are waiting for.(Because of this, I think queue and mask are same.)

And, what is the case of delivering the signal once? Is it something like that when signal of same type is delivered more than once?

Also, Most UNIX systems, do not queue signals means that only 1 signal mask bit can be set on the clear mask? Then, what happens if different type of many signals are blocked on that process? What signals are not set?

A.Cho
  • 571
  • 1
  • 6
  • 17
  • There is no queue. A signal is either pending or not. One bit. If there were a queue, you could put 5 instances of SIGINT in it, which would be different from 6 or 17 instances. – n. m. could be an AI Mar 07 '16 at 16:59
  • Can only one mask bit on? – A.Cho Mar 07 '16 at 23:12
  • No, several bits can be on. – n. m. could be an AI Mar 08 '16 at 04:51
  • Then, it means that, in signal mask, several blocked signals bit can be on. So, Why this is not mean queue the signals?(I mean because many signal bits are on) (My thinking is queue the signal == different mask bits are on) – A.Cho Mar 08 '16 at 06:03
  • A queue is a sequence of things that come and go in a specific externally-imposed order. If there is no order, there is no queue. A signal mask is a set of signals, nit a queue. – n. m. could be an AI Mar 08 '16 at 06:19

1 Answers1

1

Signal Mask: The collection of signals that are currently blocked is called the signal mask. A process can set a signal mask to tell the kernel that it does not want to receive some particular signals. Consequently, sending one of these blocked signals means that the corresponding signal handler will not be called. SIGKILL and SIGSTOP signals can't be blocked.

Signal Queue: Each process maintains a queue of signals it has received but not yet processed. A signal that has been blocked using a mask will be queued up. The process can access this queue through sigwait(), sigwaitinfo(), and similar functions.

Sourav
  • 379
  • 7
  • 13