[Mono-dev] Mac Boehm CG question

Tom Philpot tom.philpot at logos.com
Fri Jan 22 17:05:42 EST 2010


While investigating some performance problems in our application which uses the embedded Mono runtime on Mac OS X targeting 10.5 and 10.6, I noticed that several operations spent an extreme amount of time in GC_lock. That code lead me back to gcconfig.h where NO_PTHREAD_TRYLOCK is defined. I've commented out that #define it on my local Mono build and things seem MUCH faster. In fact I'm now able to do real work on more than 2 threads without a ton of overhead.

The question is now, does this check still need to be there for later versions of Mac OS X? The original commit was back in August 2003, which was probably around the timeframe of 10.2 and 10.3 and definitely before the Intel Macs. Also, since I don't have a PPC to test on, I didn't comment that #define.


ws1048-snow:mono tom.philpot$ svn diff libgc/include/private/gcconfig.h 
Index: libgc/include/private/gcconfig.h
===================================================================
--- libgc/include/private/gcconfig.h	(revision 150077)
+++ libgc/include/private/gcconfig.h	(working copy)
@@ -329,7 +329,7 @@
 #    define GETPAGESIZE() getpagesize()
       /* There seems to be some issues with trylock hanging on darwin. This
          should be looked into some more */
-#     define NO_PTHREAD_TRYLOCK
+//#     define NO_PTHREAD_TRYLOCK
 #   elif defined(__arm__)
 #    define ARM
 #    define mach_type_known



More information about the Mono-devel-list mailing list