Re[5]: [Gc] Re: Valgrind patch

Ivan Maidanski ivmai at mail.ru
Sat Mar 13 00:25:33 PST 2010


Sat, 13 Mar 2010 03:07:18 +0000 письмо от "Boehm, Hans" <hans.boehm at hp.com>:

> > Hans -
> > what do you think about using pthread_attr_getstack() in 
> > GC_get_main_stack_base() by default for Linux with threads?
> > 
> I can't immediately think of a problem, though it probably requires some testing across hardware platforms.

Ok. Let it be turned on only if USE_GET_STACKBASE_FOR_MAIN for now.

> 
> Historically, I think the problem with pthread_getattr_np has been that it isn't correctly implemented for single-threaded apps.  Hence we can't consistently rely on it.

Ok. GC is not using pthread.h in the non-threaded case (the opposite would require using -lpthread by the single-threaded clients).

> If you search for pthread_getattr_np in the gmane archives you get a fair amount of ancient history.

In http://article.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/1579, I see a recommendation to check stackaddr (returned by successful getstack()) for NULL, so I've added it to the code (only for the main thread).

> 
> Hans
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bdwgc-ivmai-239.diff
Type: application/octet-stream
Size: 1254 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20100313/7b582606/bdwgc-ivmai-239.obj


More information about the Gc mailing list