Skip to contentSkip to conversation

sigpending rework

RFC Kalaky 2 participants 2 messages Dec 13, 2004 – Dec 14, 2004

lore
Share & tools
lore

Kalaky

author
#0 lore raw

Hello,

Currently, queued RT signals go into a list of pending signals for a given task_struct (multiple RT signals can be queued). When an process dequeues a signal through sigwaitinfo() we must search the list for the given signal. This search is always O(n) where n is the number of pending signals, since we must go through all list members to ensure if a signal number is still pending.

I'm working on converting the sigpending structure into a vector of _NSIG sigqueue's for each signal number (which is quite a big work), this way we can directly access each signal list, delivering and checking any pending signals in a efficient manner.

Any thoughts ?

TIA,

Kalaky

#1 lore raw
Quoted 5 lines · Kalaky

I'm working on converting the sigpending structure into a vector of _NSIG sigqueue's for each signal number (which is quite a big work), this way we can directly access each signal list, delivering and checking any pending signals in a efficient manner.

This looks like a logical extension but the question is, is it worth it? I don't know about a case so far where this is a bottle neck. But any solution will cost every process, regardless of whether it uses signals often or not.

So, if your solution can avoid or keep the cost very very low, it might be worth using such a change. Otherwise the ol' saying applies:
avoid signals at all costs.