public OneToThreeReleasingWorkerPoolThroughputTest()
    {
        for (var i = 0; i < _numWorkers; i++)
        {
            _counters[i] = new PaddedLong();
        }

        for (var i = 0; i < _numWorkers; i++)
        {
            _handlers[i] = new EventCountingAndReleasingWorkHandler(_counters, i);
        }
    }
 public OneToThreeReleasingWorkerPoolThroughputTest()
     : base(Test_Disruptor, ITERATIONS)
 {
     ThreadPool.SetMaxThreads(NUM_WORKERS, NUM_WORKERS);
     for (int i = 0; i < NUM_WORKERS; i++)
     {
         counters[i] = new _Volatile.PaddedLong();
         handlers[i] = new EventCountingAndReleasingWorkHandler(counters, i);
     }
     workerPool = new WorkerPool<ValueEvent>(ringBuffer
                                    , ringBuffer.NewBarrier()
                                    ,new FatalExceptionHandler()
                                    ,handlers);
     
     ringBuffer.AddGatingSequences(workerPool.getWorkerSequences());
 }
Пример #3
0
        public OneToThreeReleasingWorkerPoolThroughputTest()
            : base(Test_Disruptor, ITERATIONS)
        {
            ThreadPool.SetMaxThreads(NUM_WORKERS, NUM_WORKERS);
            for (int i = 0; i < NUM_WORKERS; i++)
            {
                counters[i] = new _Volatile.PaddedLong();
                handlers[i] = new EventCountingAndReleasingWorkHandler(counters, i);
            }
            workerPool = new WorkerPool <ValueEvent>(ringBuffer
                                                     , ringBuffer.NewBarrier()
                                                     , new FatalExceptionHandler()
                                                     , handlers);

            ringBuffer.AddGatingSequences(workerPool.getWorkerSequences());
        }
        public OneToThreeReleasingWorkerPoolThroughputTest()
        {
            for (var i = 0; i < _numWorkers; i++)
            {
                _counters[i] = new PaddedLong();
            }
            for (var i = 0; i < _numWorkers; i++)
            {
                _handlers[i] = new EventCountingAndReleasingWorkHandler(_counters, i);
            }

            _workerPool = new WorkerPool <ValueEvent>(_ringBuffer,
                                                      _ringBuffer.NewBarrier(),
                                                      new FatalExceptionHandler(),
                                                      _handlers);

            _ringBuffer.AddGatingSequences(_workerPool.GetWorkerSequences());
        }