On 23 June 2015 at 11:46, Paolo Bonzini <pbonz...@redhat.com> wrote: > SuspendThread was pretty much the only way to emulate signals. > Initially I used SetThreadContext to redirect execution to cpu_signal; > that was more complicated, but in retrospect it would have avoided the > problems with memory barriers and with asynchronous SuspendThread. It > certainly would have saved the AdaCore people a lot of debugging time. :( > > For 2.5, however, I wonder if SuspendThread/ResumeThread is needed at > all now that cpu_exit doesn't have to undo block chaining anymore. Even > on POSIX platforms the signal might not be necessary anymore.
Yeah, I was wondering that too. All we're really doing is setting three flag variables, so the suspend/resume or signal is just getting us atomicity of those flag changes. It might be possible to redesign things a bit to not require the atomicity part. -- PMM