EventLoopScheduler bug?
-
יום שני 02 אפריל 2012 06:02
I think I found a bug in EventLoopScheduler. Here is a unit test which reproduces it:
using System; using System.Threading; using NUnit.Framework; using System.Reactive.Concurrency; namespace EventLoopSchedulerTests { [TestFixture] public class EventLoopSchedulerTests { [Test] public void TestEventLoopScheduler() { var scheduler = new EventLoopScheduler(); scheduler.Schedule(TimeSpan.FromMinutes(1), () => { }); Thread.Sleep(1000); scheduler.Schedule(TimeSpan.FromMinutes(2), () => { }); Thread.Sleep(1000*60); } } }If you run this unit test, one processor core will run on 100% for one minute.
I looked with Reflector in the code and analysed it and I think the problem is that the ManualResetEvent is not reset if a second action is scheduled after the "current" one.
Is this a known problem? Is there a workaround? Is it been fixed in 2.0?
כל התגובות
-
יום שני 02 אפריל 2012 23:04בעלים
Known bug as mentioned in passing in the v2.0 Beta release notes. Will be fixed going forward.
using (Microsoft.Sql.Cloud.DataProgrammability.Rx) { Signature.Emit("Bart De Smet"); }
- הוצע כתשובה על-ידי Bart De Smet [MSFT]Owner יום שני 02 אפריל 2012 23:06
- סומן כתשובה על-ידי Tomas12 יום שלישי 03 אפריל 2012 18:57