[Mono-dev] when to call mono_thread_attach
Victor.Ng at CIBC.ca
Wed Apr 13 13:19:50 EDT 2011
I'm trying to embed a Mono process inside of CPython but I'm having some trouble with threads.
When am I supposed to call mono_thread_attach?
Right now, I'm invoking it immediately after mono_jit_init and immediately before I instantiate and initialize an object and prior to finding and invoking a method on an object.
I still get SEGSEGV once in a while though when I try running multithreaded code. I'm guessing that there's some important piece of information I'm missing on when I should or shouldn't be using mono_thread_attach.
Also, how do I know what objects I have to call mono_free on? I can't seem to find a good reference on that topic. Are there also objects where I have to 'pin' them into memory for the Mono GC?
More information about the Mono-devel-list