[Mono-dev] Single thread scheduler for Threading.Timers patch

Rafael Ferreira lists at ophion.org
Wed Jun 14 02:04:14 EDT 2006


Howdy, 

The attached patch changes the current Threading.Timer class to use a
single thread scheduler instead of the current 1 thread per timer logic.
I also spent a lot of time working on the Timer unit tests so they more
consistently pass as well as fixing the "NotWorking" tests. 

Some key features include:

* A single thread handles firing all timer jobs thus allowing a much
greater number of Timers to be defined - Fixing bug #65734
* Timer scheduler is only started after the first System.Threading.Timer
is created (lazy init)
* Timer scheduler thread dies if there are no more timer jobs in its Job
queue (early termination)
* Scheduler can spit out debug info by exporting the MONO_TIMER_DEBUG
environment variable

Of course, I don't expect this patch to be accepted without some degree
of scrutiny so comments/concerns are appreciated and I can commit the
code once we're all comfortable with it.  

Cheers, 

- raf



-------------- next part --------------
A non-text attachment was scrubbed...
Name: timer.patch
Type: text/x-patch
Size: 18279 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060613/46907583/attachment.bin 


More information about the Mono-devel-list mailing list