3 ms·
Of course you don't spawn a thread from the signal handler. You start it first thing in main and park it waiting for a wakeup.
by gpderetta 7mo ago
Of course you don't spawn a thread from the signal handler. You start it first thing in main and park it waiting for a wakeup.
- kelnos 7mo agoAh duh, hadn't thought of that. Same pipe trick, but with another thread blocking on the read end. That is a much simpler change than refactoring the main thread to poll on several FDs instead of just blocking in recv().