Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some questions about linux signals

Tags:

linux

signals

  1. Is (SIGRTMIN + 1) safe for inter-process communication? Will it change in different processes?

  2. Are there any differences to use sigqueue(2) or kill(2) to send standard signals and real time signals?
    If I use sigqueue(2) to send a series of SIGUSR1(standard signals) and handle them slowly, are there mutiple instances of SIGUSR1 in the queue?
    What about using kill(2) to send SIGRTMIN(real time signals)? Will they be queued?

like image 297
majie Avatar asked Jan 18 '23 05:01

majie


1 Answers

This post is old news, but it ranked high on Google and is unfortunately misleading so here are some clarifications:

  1. One can send any signal with any of those functions
  2. sigqueue enables passing some more "context" [e.g. information, @see siginfo et. al], as opposed to kill/raise
  3. As per the real time signals - it doesn't matter if they are sent or queued - they will behave the same [e.g. queued cf. grouped as with the non RT signals]
like image 94
Ron Munitz Avatar answered Jan 24 '23 21:01

Ron Munitz