On Fri, Sep 29, 2023 at 12:44:46PM +0400, Maksim Dmitrichenko wrote:
> Сигналы не накапливаются в очередь.
Мне казалось, что вполне себе накапливаются, при SA_RESTART.
Из man 7 signal:
Standard signals do not queue. If multiple instances of a standard signal are generated while that signal is blocked, then only one instance of the signal is marked as pending (and the signal will be delivered just once when it is unblocked). In the case where a standard signal is already pending, the siginfo_t structure (see sigaction(2)) associated with that signal is not overwritten on arrival of subsequent instances of the same signal. Thus, the process will receive the information associated with the first instance of the signal.
Очередь есть только у RT-сигналов.
В манах эта модель поведения называется "BSD semantics".
Модель без накопления называется "SysV semantics".
Можно выбрать алгоритм для конкретного сигнала.
ЕМНИП, это касается другого - когда система считает, что сигнал обработан и можно вызывать хендлер опять.