[Gc] Re: Unregistering the main thread
ludo at gnu.org
Mon Sep 15 14:19:44 PDT 2008
"Boehm, Hans" <hans.boehm at hp.com> writes:
> A blocking system call doesn't normally stop allocation or garbage
> collection anyway.
Hmm, alright. The documentation I had missed must be this:
In particular, it is very difficult for the collector to stop all
other threads in the system and examine the register contents. This
is currently accomplished with very different mechanisms for some
Pthreads implementations. The Solaris implementation temporarily
disables much of the user-level threads implementation by stopping
kernel-level threads (`lwp's). The Linux/HPUX/OSF1 and Irix
implementations sends signals to individual Pthreads and has them wait
in the signal handler.
> GC_unregister_my_thread isn't actually intended
> for this kind of use. Using it is potentially dangerous, since frames
> nearer the cool end of the stack will also no longer be scanned.
> I would be inclined to turn this into eiher a no-op or (on pthreads
> with recent GC) GC_do_nonblocking(). The latter avoids having the GC
> send signals that interrupt (and hopefully restart) the system call.
What do you mean by `GC_do_nonblocking ()'?
More information about the Gc