Re: External thread suspension (again)
Hans Boehm <Hans.Boehm <at> hp.com>
2006-06-04 04:48:54 GMT
Sorry about the slow resposne.
In general, this also looks like a better approach to me. Thanks.
1) I don't see where the SUSPENDED flag gets set in response to
GC_suspend_thread. It gets set in GC_suspend_self(), but I don't
think you get there unless it has already been set?
2) You should probably call GC_brief_async_signal_safe_sleep().
Last time I looked nanosleep wasn't technically async-signal-safe,
but I think select() always has been.
3) Have you thought about the various possible signal races, and which
signals are masked at what point? I haven't yet had a chance to. It
may be fine, but if there's an obvious argument that it is, a
comment would be great.
4) IIRC, GC_start_blocking() has a fundamental issue in that there isn't
really a good way to guarantee that all callee-saves registers are visible
onthe stack at the right point. The result might be very occasional
failures. So long as this is used only for debugging, and since this
is fixed with an interface change in 7.0, which can be easily accomodated
by your patch, I'd lean towards ignoring this for now. The more
ambitious, and more correct, solution would be to backport the gc7