Gantua (gantua@pleroma.marchera-pas.fr)'s status on Thursday, 10-Sep-2026 02:30:30 JST
-
Embed this notice
@dalias @jschauma @mirabilos @lispi314 A signal can be delivered to an arbitrary thread unless you carefully mask it in every thread that you create.
If you have a stupid signal handler that sets a global variable its_time_to_exit = 1 which is just read elsewhere as a volatile, then once you add threads, suddenly you have an memory ordering issue: the thread that wrote it is not necessarily the same as the one who read it, and nobody was prepared to do atomic shenanigans to ensure the new value is visible to the reader, so the program sometimes does not stop.
threads really complicate everything.