コード例 #1
0
 protected override int RawThreadGroups => 4;        //Environment.ProcessorCount / 2;
 protected override BenchmarkWorker[] BenchInstanceGenerator(ManualResetEvent syncPrimitive, IThreadGroupIndex threadGroupIndex) =>
 new BenchmarkWorker[]
 {
     new ManualResetEventSetterWorker(syncPrimitive, this, $"{threadGroupIndex}", $"{threadGroupIndex}:S"),
     new ManualResetEventReSetterWorker(syncPrimitive, this, $"{threadGroupIndex}", $"{threadGroupIndex}:R")
 };
コード例 #2
0
 protected override ManualResetEvent SyncPrimitiveFactory(IThreadGroupIndex threadGroupIndex) => new ManualResetEvent(false);
コード例 #3
0
 public BenchmarkWorker[] CreateBenchInstance(IThreadGroupIndex threadGroupIndex)
 => BenchInstanceGenerator(CreateOrGetStoredSyncPrimitive(threadGroupIndex), threadGroupIndex)
 ;
コード例 #4
0
 protected virtual BenchmarkWorker[] BenchInstanceGenerator(TSyncPrimitive syncPrimitive, IThreadGroupIndex threadGroupIndex)
 => Array.Empty <BenchmarkWorker>()
 ;
コード例 #5
0
 protected virtual TSyncPrimitive SyncPrimitiveFactory(IThreadGroupIndex threadGroupIndex) => default(TSyncPrimitive);
コード例 #6
0
 protected override ConcurrentQueue <object> SyncPrimitiveFactory(IThreadGroupIndex threadGroupIndex) => new ConcurrentQueue <object>();
コード例 #7
0
 protected override BenchmarkWorker[] BenchInstanceGenerator(ConcurrentQueue <object> syncPrimitive, IThreadGroupIndex threadGroupIndex) =>
 new BenchmarkWorker[]
 {
     new ConcurrentQueueWriterWorker(syncPrimitive, this, $"{threadGroupIndex}", $"{threadGroupIndex}:W"),
     new ConcurrentQueueReaderWorker(syncPrimitive, this, $"{threadGroupIndex}", $"{threadGroupIndex}:R")
 };