News for hackers. Stuff that matters.
Re:Should you be scared of Unix signals? by plorkyeran on Tuesday June 14, 2016 @02:51PM (#11904339)
The equivalent of SIGSEGV/SIGBUS on Mach is handled in basically the way he describes. On an access violation, it suspends the thread and delivers a message to the registered port. The thing listening on the port (in a different thread or even different process) receives the message, does whatever it needs to do, and then sends a response, after which the original thread is woken back up. From the perspective of the violating thread it was handled synchronously, but the actual implementation was an async message queue.
Re:Should you be scared of Unix signals? by gpderetta on Tuesday June 14, 2016 @03:56PM (#11904840)
It is not much better though. If it is another thread it has to work under the same async signal safety rules of a signal handler (the blocked thread might be holding an arbitrary mutex). If it is another process, there isn't a lot it can do.