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

Dick Porter dick at ximian.com
Tue Aug 12 05:55:07 EDT 2003


On Tue, 2003-08-12 at 04:25, David Jeske wrote:
> On Mon, Aug 11, 2003 at 04:38:53PM +0100, Dick Porter wrote:
> > You need to make sure your whole embedded application is using the
> > libgc-wrapped pthreads calls, not just the mono part.  See
> > http://bugzilla.ximian.com/show_bug.cgi?id=46137 for more details.
> 
> While this seems acceptable for now, in the long term this seems like
> a problem. As someone else pointed out, this will prevent Mono from
> being embeddable inside any pre-built applications.
> 
> Can someone elaborate more about what causes this problem, and what we
> might do about it in the future? For example:

Its a libgc requisite.

> 
> 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.

> 
> What is the problem with having some code talk directly to pthreads,
> and some code talk to libgc's pthread overrides?

Segmentation faults.

- Dick




More information about the Mono-devel-list mailing list