[Gc] further pthread foo

Andy Wingo wingo at pobox.com
Sat Mar 19 15:34:30 PST 2011


Hi Ivan,

On Sat 19 Mar 2011 22:25, Ivan Maidanski <ivmai at mail.ru> writes:

> Try to compile libgc with -DGC_ASSERTIONS but without
> -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK.

OK, will do.  Thanks for the suggestion, and sorry for the burden.  You
must get the worst bugs!

> BTW. Why do you use GC_call_with_gc_active()? It should be no-op in your
> case - the thread is stopped and scanned after you call
> GC_register_my_thread. (GC_call_with_gc_active is used primarily inside
> GC_do_blocking calls).

We have scm_with_guile and scm_without_guile, which invoke a procedure
in and out of Guile mode.  scm_with_guile nests as you would think it
would, and scm_without_guile can only be called in Guile mode.

If a thread is not in Guile mode, it shouldn't be active for GC purposes
-- shouldn't be in the thread set to stop -- so it goes through a
do_blocking.  scm_with_guile therefore goes through a
GC_call_with_gc_active, even in the case that it's not in the extent of
a GC_do_blocking context call.

So yes, it's a no-op, and harmles in this case.

Regards,

Andy
-- 
http://wingolog.org/


More information about the Gc mailing list