예제 #1
0
 public void CreateAtomicValContext()
 {
     _atomicVal        = new OptimisticallyLockedValue <Vector2>(new Vector2(-1f, -1f));
     _atomicValBarrier = new ManualResetEvent(false);
     _atomicValThreads = new List <Thread>();
     BenchmarkUtils.PrepareThreads(NumThreads, _atomicValBarrier, WithAtomicVal_Entry, _atomicValThreads);
 }
 public void CreateAtomicLongContext()
 {
     _atomicLong        = new AtomicLong(0L);
     _atomicLongBarrier = new ManualResetEvent(false);
     _atomicLongThreads = new List <Thread>();
     BenchmarkUtils.PrepareThreads(NumThreads, _atomicLongBarrier, WithAtomicLong_Entry, _atomicLongThreads);
 }
예제 #3
0
 public void CreateContextualFuncsContext()
 {
     _contextualFuncsBarrier = new ManualResetEvent(false);
     _contextualFuncsThreads = new List <Thread>();
     _contextualFuncsUser    = new LockFreeReference <User>(new User(0, ""));
     _contextualFuncsInt64   = new LockFreeInt64(0L);
     BenchmarkUtils.PrepareThreads(NumThreads, _contextualFuncsBarrier, WithContextualFuncs_Entry, _contextualFuncsThreads);
 }
 public void CreateLockedLongLessGranularContext()
 {
     _lockedLessGranularLongLock    = new object();
     _lockedLessGranularLong        = new AtomicLong(0L);
     _lockedLessGranularLongBarrier = new ManualResetEvent(false);
     _lockedLessGranularLongThreads = new List <Thread>();
     BenchmarkUtils.PrepareThreads(NumThreads, _lockedLessGranularLongBarrier, WithLockedLongLessGranular_Entry, _lockedLessGranularLongThreads);
 }
예제 #5
0
 public void CreateLockedLongContext()
 {
     _lockedLongLock    = new object();
     _lockedLong        = new LockFreeInt64(0L);
     _lockedLongBarrier = new ManualResetEvent(false);
     _lockedLongThreads = new List <Thread>();
     BenchmarkUtils.PrepareThreads(NumThreads, _lockedLongBarrier, WithLockedLong_Entry, _lockedLongThreads);
 }
예제 #6
0
 public void CreateAtomicValContext()
 {
     _atomicVal        = new LockFreeValue <Vector2>(new Vector2(5f, 10f));
     _atomicValBarrier = new ManualResetEvent(false);
     _atomicValThreads = new List <Thread>();
     _atomicValRemainingThreadCount = new LockFreeInt32(NumThreads);
     BenchmarkUtils.PrepareThreads(NumThreads, _atomicValBarrier, WithAtomicVal_EntryA, _atomicValThreads);
     BenchmarkUtils.PrepareThreads(NumThreads, _atomicValBarrier, WithAtomicVal_EntryB, _atomicValThreads);
 }
예제 #7
0
 public void CreateManualLoopContext()
 {
     _manualLoopVector2 = new Vector2(5f, 10f);
     _manualLoopBarrier = new ManualResetEvent(false);
     _manualLoopThreads = new List <Thread>();
     _manualLoopRemainingThreadCount = new LockFreeInt32(NumThreads);
     BenchmarkUtils.PrepareThreads(NumThreads, _manualLoopBarrier, WithManualLoop_EntryA, _manualLoopThreads);
     BenchmarkUtils.PrepareThreads(NumThreads, _manualLoopBarrier, WithManualLoop_EntryB, _manualLoopThreads);
 }