public void Execute() { var remaining = new RemainingWorkItem(_countdown, _count); for (var j = 0; j < _count; j++) { _pool.UnsafeQueueUserWorkItem(remaining, _local); } }
public void HeliosBenchmark(IThreadPool <IThreadPoolWorkItem> pool, Counts counts) { using (var mre = new CountdownEvent(1)) { var workItem = new RemainingWorkItem(mre, counts.Items); for (long i = 0; i < counts.Items; i++) { pool.UnsafeQueueUserWorkItem(workItem, false); } mre.Wait(); } }
public void Global_02_FullLoad(IThreadPool <IThreadPoolWorkItem> pool, Counts counts) { for (var j = 0; j < counts.Iterations; j++) { using var countdown = new CountdownEvent(1); var remaining = new RemainingWorkItem(countdown, counts.Items); for (var i = 0; i < counts.Items; i++) { pool.UnsafeQueueUserWorkItem(remaining, false); } countdown.Wait(); } DrainQueues(pool); }
public void Global_01_PartialLoad(IThreadPool <IThreadPoolWorkItem> pool, Counts counts) { for (var j = 0; j < counts.Iterations; j++) { using var countdown = new CountdownEvent(1); var signal = new RemainingWorkItem(countdown, counts.Items); for (var i = 0; i < counts.Items; i++) { pool.UnsafeQueueUserWorkItem(signal, false); } countdown.Wait(); } // TODO: Item adding is single threaded here DrainQueues(pool); }