[Gc] Comment on Mono GC_thread_is_registered

Hans Boehm Hans.Boehm at hp.com
Mon Sep 14 12:22:35 PDT 2009


I'm inclined to agree that we don't want to add it.  I suspect the Mono
code predates the current thread registration interface.

Hans

On Mon, 14 Sep 2009, Ivan Maidanski wrote:

> Hi!
>
> As I see, Mono also has GC_thread_is_registered() in its gc.h (but I've failed to find out where it (or its wrapper - mono_gc_is_gc_thread) is actually used).
>
> This could be easily added to our gc.h but I don't think it's worth cause:
> - of little use (IMHO);
> - easily emulated using thread register/unregister (with some performance loss):
>
> int GC_thread_is_registered(void) // or GC_thread_is_my_registered
> {
> // assumes GC already entered multi-threaded mode
> struct GC_stack_base sb;
> sb.mem_base = &sb; // no need to call GC_call_with_stack_base() here (even on IA64)
> if (GC_register_my_thread(&sb) == GC_SUCCESS) {
>   (void)GC_unregister_my_thread();
>   return 0;
> }
> /* GC_DUPLICATE */
> return 1; /* is registered */
> }
>
> Bye.
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>


More information about the Gc mailing list