[Mono-devel-list] Embeding MONO and (p)threads

David Jeske jeske at chat.net
Tue Aug 12 13:44:20 EDT 2003

On Tue, Aug 12, 2003 at 10:55:07AM +0100, Dick Porter wrote:
> > Why does libgc need to override pthread functions? 
> It needs to be able to stop all the threads when it does a collection,
> and therefore it needs to know about all threads.  Theres some
> documentation about why its done by cpp tricks rather than dynamic
> linker tricks, but I can't remember the details offhand.

I see. The hard requirement is that when mono code is executing, the
stack in use must be for a thread which is known to libgc, so it gets
a full view of the root set during collection.

In theory everything would work correctly if a call into Mono thunked
into another thread created by the Mono runtime/libgc thread
calls. This seems somehow safer anyhow.

I wonder if the Native Posix Thread Library in RedHat 9 does anything
to make this easier:


David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske at chat.net

More information about the Mono-devel-list mailing list