|
|
Subscribe / Log in / New account

This is why we can't have safe cancellation points

This is why we can't have safe cancellation points

Posted Apr 15, 2016 17:21 UTC (Fri) by pm215 (subscriber, #98099)
Parent article: This is why we can't have safe cancellation points

A lot of this post sounded remarkably familiar, because it turns out that QEMU's linux-user code (where it emulates a binary for one architecture on a host with a different architecture, passing system calls through to the host) needs to do a very similar trick with a signal handler that has to look at the interrupted PC to see whether it was just before or just after the syscall instruction.

(For QEMU the problem that has to be solved is making sure that incoming signals interrupt emulated guest system calls -- if the signal arrives before we execute the host syscall instruction we must abandon emulation of the guest syscall, otherwise we might block forever. There's no way to close the race window completely without having the signal handler check the PC to see "did we actually execute that instruction yet?".)


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds