[Gc] Comment on Mono GC_thread_is_registered

Zoltan Varga vargaz at gmail.com
Mon Sep 14 11:57:52 PDT 2009


Hi,

   It does. mono uses a modified version of 6.4.

               Zoltan

On Mon, Sep 14, 2009 at 9:22 PM, Hans Boehm <Hans.Boehm at hp.com> wrote:

> 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/
>>
>>  _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20090914/e71b1f04/attachment.htm


More information about the Gc mailing list