[Gc] Win32: DLLs and thread registration

Christian Gudrian gn at fluidon.dyndns.info
Tue Feb 12 04:15:39 PST 2008


Christian Gudrian wrote:

> I did exactly that: I added a call to GC_init_parallel() at the very end 
> of GC_use_DllMain().

In this setup you must not call GC_INIT() but instead only 
GC_use_DllMain().  The reason is that GC_INIT() registers the main 
thread (which is good) but uses the wrong method since 
GC_win32_dll_threads still is 0 (which is bad).  Since GC_use_DllMain() 
now calls GC_init_parallel() (now with GC_win32_dll_threads set to 1) 
which in turn finally calls GC_INIT() there is no need to call GC_INIT() 
explicitly anyway.

Christian


More information about the Gc mailing list