Re[2]: [Gc] GC_INIT? Threads?

Ivan Maidanski ivmai at mail.ru
Fri Oct 4 13:44:04 PDT 2013


 Hi Devis,


Wed,  2 Oct 2013, 20:02 -05:00 from The Devils Jester <thedevilsjester at gmail.com>:
>Not to resurrect this topic (the original question was answered) but the same solution in a related application (if I create a thread with std::thread) does not return success with GC_register_my_thread. Is the GC automatically registering std threads?  May be. It depends on configuration and platform.

> Is there any way to check?   /* Return non-zero (TRUE) if and only if the calling thread is        */
  /* registered with the garbage collector.                             */
  GC_API int GC_CALL GC_thread_is_registered(void);

> Would that cause said function to fail? gc.h:
#define GC_SUCCESS 0
#define GC_DUPLICATE 1          /* Was already registered.              */
#define GC_UNIMPLEMENTED 3 /* Not yet implemented on this platform.     */

Regards,
Ivan

>
>On Tue, Aug 20, 2013 at 8:06 PM, The Devils Jester  < thedevilsjester at gmail.com > wrote:
>>@Bruce, I do not know why I had a pointer instead of a reference there, changing that fixed the whole issue and the GC seems to be ok with the new thread and all appears to work fine.  Thank you for your suggestions and eagle eye.
>>
>>@Hans, unfortunately I do not have access to the lower level thread creation in this situation as I go through a third party library.  Fortunately it was a simple mistake and Bruce's suggestions worked well, so I didn't have to manually manage/create the thread.
>_______________________________________________
>Gc mailing list
>Gc at linux.hpl.hp.com
>https://www.hpl.hp.com/hosted/linux/mail-archives/gc/


-- 
Иван Майданский
#define GC_SUCCESS 0
#define GC_DUPLICATE 1          /* Was already registered.              */
#define GC_NO_THREADS 2         /* No thread support in GC.             */
        /* GC_NO_THREADS is not returned by any GC function anymore.    */
#define GC_UNIMPLEMENTED 3 /* Not yet implemented on this platform.     */

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://napali.hpl.hp.com/pipermail/gc/attachments/20131005/e925cb1a/attachment.htm


More information about the Gc mailing list