EventLoopScheduler bug?
-
02 April 2012 6: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?
Semua Balasan
-
02 April 2012 23:04Pemilik
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"); }
- Disarankan sebagai Jawaban oleh Bart De Smet [MSFT]Owner 02 April 2012 23:06
- Ditandai sebagai Jawaban oleh Tomas12 03 April 2012 18:57