[Gc] Attaching and dettaching existing threads

Thong (Tum) Nguyen tum@veridicus.com
Mon, 13 Oct 2003 17:12:49 +1300


Hi,

The .NET (CLI) P/Invoke architecture allows native OS threads created
outside of the runtime to invoke "managed" objects.  This would require the
GC to be aware of these threads as soon as they enter the runtime.

There currently doesn't seem to be a standard cross platform way of
attaching and detaching existing threads to the GC.  This seems trivial to
implement (for linux & windows anyway) since a lot of the code for this
already exists but is tucked away.

How about adding some GC_thread_attach and GC_thread_detach to the public
API.  Does anyone have any opinions on this issue?  

All the very best,

^Tum