[[!meta copyright="Copyright © 2011, 2013 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] For delivering a signal, Mach forwards an `msg_sig_post` message from the invoker of `kill` to the target process. The target process' [[signal_thread]] job is it to listen to such messages and to set up signal handler contexts in other threads. --- [[!tag open_issue_documentation]] # IRC, freenode, #hurd, 2011-04-20 bugs around signals are very tricky signals are actually the most hairy part of the hurd and the reason they're aynchronous is that they're handled by a second thread (so yes, every process on the hurd has at least two threads) braunr: How to solve the asynch problem then if every process has two threads? the easiest method would be to align ourselves on what most other Unices do establish a "signal protocol" between kernel and userspace with a set of signal info in a table, most likely at the top of the stack but this is explicitely what the original Mach developers didn't want, and they were right IMO having two threads is very clean, but it creates incompatibilites with what POSIX requires so there might be a radical choice to make here and i doubt we have the resources to make it happen What is the advantage of having two threads per process, a per the original design? it's clean you don't have to define async-signal-safe functions it's like using sigwait() yourself in a separate thread, or multiplexing them through signalfd() Regardless of the advantages, isn't two threads per process a waste of resources? sure it is but does it really matter ? mach and the hurd were intended to be "hyperthreaded" [[open_issues/multithreading]].