[Mono-list] How does mono translated into C++ Native Code in Linux

Jonathan Pryor jonpryor at vt.edu
Mon Sep 17 03:09:46 UTC 2012


On Sep 16, 2012, at 9:05 PM, John Chen <johnxhc at gmail.com> wrote:
> Question, when Mono using AutoEvent inside managed code, what does it corresponding it to? I know in Windows it translated into Windows Event object (I could use the same handle in C, C++), how about in Linux?

On Linux, "io-layer" is used to implement a WinAPI subset for use on non-Windows platforms, e.g. CreateEvent():

	https://github.com/mono/mono/blob/master/mono/io-layer/events.c#L321

It is highly unlikely that your code could rely on these unless your native code is linking against libmono.so. Furthermore, on many systems these WinAPI exports have a "Mono" prefix, e.g. on OS X:

	$ dyldinfo -export /Library/Frameworks/Mono.framework/Libraries/libmono-2.0.dylib | grep CreateEvent
	0x001B6280 _ves_icall_System_Threading_Events_CreateEvent_internal
	0x001D5EB0 _MonoCreateEvent 

 - Jon



More information about the Mono-list mailing list