2 ms·
> Signals are definitely a pain point on Unix - they're decently easy to implement on the OS side, but you just have to think there was a better way. I imagine
by zokier 9y ago
> Signals are definitely a pain point on Unix - they're decently easy to implement on the OS side, but you just have to think there was a better way.
I imagine kqueue would be one of the better ways?
- DSMan195276 9y agoYes, I don't know tons about it but in general kqueue looks like a good solution, and like what I would want for a generic solution (Though obviously, kqueue goes beyond just signals, and might be a little bit complicated when talking about a solution just for signals). My thinking is more along the lines that signals are literally just user-land interrupts, and it would have been nice if they went for something other then that so that you don't have to worry about user-land code being interrupted, and all the ugliness that follows that. But I suppose it's worth keeping in mind that the first Unix didn't feature O_NONBLOCK or `select`, and the syscalls had to be cancel-able, so there is only so much they could do. And signal handlers help avoid having to call some conditional check after every syscall. But I fell like having something similar to `signalfd` that was a standard fd (STDSIGNAL_FILENO I suppose) from the start would have been nicer overall.