Luca, le mer. 01 mars 2023 19:01:02 +0100, a ecrit: > I still have to fully understand the existing code, so this might be > something completely wrong... but if interrupting an rpc is a complex thing > to do reliably in user space, why not add some kernel support? Also, how do > you test this code?
Mach already provides support for interruption. But it cannot deal with the user code itself. One way could be to add a pointer to the mach_msg call for the kernel to check the cancel flag itself, but that becomes relatively dirty, compared to just dealing with the matter in userland, which on the other hand allows userland to introduce whatever interruption/cancelation/signal/etc. notions at will. > Also, if I understand correctly, in case the thread finished the syscall and > successfully received a message, but didn't return to userspace yet, isn't > there the risk of losing the message, with the current approach? IIRC that part is not interruptible, so either we get a message, or we get interrupted, but not both. Samuel