[Mono-list] Multiple threads slower than multiple processes?

SvenG sgroot at gmail.com
Tue Feb 24 06:14:48 EST 2009

SvenG wrote:
> However, when I use two threads in the same process (which does exactly
> the same thing as just running two instances of the application).It takes
> 290 seconds, a whopping 40% slower! CPU usage is only about 180%, 90% per
> thread, and the CPU time consumed by each thread is also more than the CPU
> time consumed by the single-thread process.
Some more research points to the garbage collector. It appears the GC
suspends all threads while it is running. Two facts indicate that this is
the case: 1. the threads appear to be suspended for the 10% that they are
idle; and 2. the amount of time the threads are idle corresponds exactly to
the amount of time spent in the GC in the other threads.

This is a huge problem for me. It essentially means that any code that is
hard on the GC will diminish the ability of the process to run multiple

Could anyone confirm whether this is the case? And if so, is there anything
I can do to alleviate the problem?
View this message in context: http://www.nabble.com/Multiple-threads-slower-than-multiple-processes--tp22177940p22179952.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list