[Mono-dev] Initialize mono on non main thread

Alex Rønne Petersen alex at alexrp.com
Thu Jun 9 14:51:22 UTC 2016


Yes, this is definitely possible.

I would recommend that you look at the (now open source)
Xamarin.Android Mono glue code:
https://github.com/xamarin/xamarin-android/tree/master/src/monodroid/jni

Regards,
Alex

On Thu, Jun 9, 2016 at 4:10 PM, nicob <nicolasbotto at gmail.com> wrote:
> Hi, I'm initializing Mono using Java JNI. The JNI code doesn't run on the
> main thread, therefore I get segmentation faults. I've tried
> mono_thread_attach (mono_domain_get_root_domain and mono_domain_get) but
> that's the place where the SIGSEGV is generated.
>
> Can Mono be initialized on a non main thread? As I'm using JNI I've
> implemented the signal chaining to avoid segmentation faults.
>
> My code runs perfectly if you have only one thread, otherwise it fails with
> a SIGSEGV.
>
> Thanks!
>
>
>
> --
> View this message in context: http://mono.1490590.n4.nabble.com/Initialize-mono-on-non-main-thread-tp4667956.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list


More information about the Mono-devel-list mailing list