public void MultiThreadedAddOk() { const int threadCount = 1000; const int threads = 10; const int count = threads * threadCount; var c = new ConcurrentGrowList <int>(); using (var start = new ManualResetEvent(false)) using (var finish = new CountdownEvent(threads)) { for (var t = 0; t < threads; t++) { var id = t; Task.Factory.StartNew(() => { start.WaitOne(); var startIndex = id * threadCount; for (var i = 0; i < threadCount; i++) { c.Add(startIndex + i); } finish.Signal(); }); } start.Set(); finish.Wait(); Assert.Equal(Enumerable.Range(0, count), c.OrderBy(x => x)); } }