[Mono-devel-list] Re: Mono-devel-list digest, Vol 1 #1574 - 16 msgs

Paolo Molaro lupus at ximian.com
Fri Apr 1 05:14:37 EST 2005

On 03/31/05 Michael Rasmussen wrote:
> Yes, but this does not affect my solution. I do not you threads, only a
> simple process fork. Fork() and pthread_create are two entirely
> different things technologically speaking.

The issue is that mono will use thread-specific data to execute
the manage->unamanged transition after fork in the child (to
pinvoke exec, for example), but that data is not there anymore.
Currently there are two solutions to this issue:
*) put the fork+exec in a helper library that you'll call
using pinvoke
*) write the IL code to perform the fork+exec (either using
Re.Emit or by having an assembly with it). You'd need to get
a pointer to the fork and exec functions and execute them with
the calli instruction. The first option is preferred for
portability and easy of implementation.


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list