[Mono-bugs] [Bug 624849] BlockingCollection<T> takes 100% cpu when blocking for an element

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jul 31 13:14:34 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=624849

http://bugzilla.novell.com/show_bug.cgi?id=624849#c6


--- Comment #6 from Rickard Edström <ickard at gmail.com> 2010-07-31 17:14:33 UTC ---
This reduces cpu usage to alot on this machine. However, when comparing
BlockingCollection (mono master) running on .net, with the built-in .net 4
BlockingCollection, the mono version takes about 2% cpu, while the built-in
does not show up at all (less than 1%).
I looked at the code and it seems there are no usage at all of any signaling or
something. The .net version probably uses ManualResetEventSlim or SemaphoreSlim
to actually sleep until it is signaled (by adding an element). The mono one
just spins alot which is plain wrong. (spinning should afaict only be used in a
short while before actually waiting, but this behaviour is built-in to
ManualResetEventSlim and SemaphoreSlim)

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list