Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Messageprocessing.
Цель.Сравнить реализации.
Измерения.        ProcessingTime. T/(iterCount х producersCount)
Измерения. 1.   Start producers thread. 2.   Save start time. 3.   Signal producers. 4.   Wait for completing. 5.   Save f...
Измерения.            Producer.while (!start)   SwitchToThread();for(i = 0;i < iterCount;++i)   if(processor.Queue(msg));
Измерения.       ProcessMessage.cnt=Increment(&processedCnt);if(cnt == iterCnt*producersCnt)  SetEvent(completeEvent);
Измерения.          ProcessTest.startTime = rdtsc();start = true;WaitFor(completeEvent);finishTime = rdtsc();
Код.     MessageProcessor.(MessageQueue + ThreadPool).
Код. FakeProcessor.voidQueue(Task*msg){  msg->Process();}
Код.TrivialProcessor.CircularBuffer      +    Mutex       + ThreadPool
Код.                                          bufferTrivialProcessor.              0                               1Circul...
Код.LockFreeProcessor. CircularBuffer       +     Magic        +  ThreadPool
Код.LockFreeProcessor.old = Increment(&inserter) - 1;old &= mask;if(0 != CompareExchange(      &_array[old], newVal, 0)){ ...
Код.MpscProcessor.n x MpscQueue       +  ThreadPool       +   rand() % n
Код.MpscProcessor.i = rand() % n;queues[i].Push(msg);
Результат.
Результат.
Результат.
Результат.
За децентрализацию!!!
Всемспасибо!!!
Upcoming SlideShare
Loading in …5
×

CiklumCPPSat24032012:GennadiyMaryanichenko-ScalableMessageProcessing

327 views

Published on

Published in: Technology, Spiritual
  • Be the first to comment

  • Be the first to like this

CiklumCPPSat24032012:GennadiyMaryanichenko-ScalableMessageProcessing

  1. 1. Messageprocessing.
  2. 2. Цель.Сравнить реализации.
  3. 3. Измерения. ProcessingTime. T/(iterCount х producersCount)
  4. 4. Измерения. 1. Start producers thread. 2. Save start time. 3. Signal producers. 4. Wait for completing. 5. Save finish time.
  5. 5. Измерения. Producer.while (!start) SwitchToThread();for(i = 0;i < iterCount;++i) if(processor.Queue(msg));
  6. 6. Измерения. ProcessMessage.cnt=Increment(&processedCnt);if(cnt == iterCnt*producersCnt) SetEvent(completeEvent);
  7. 7. Измерения. ProcessTest.startTime = rdtsc();start = true;WaitFor(completeEvent);finishTime = rdtsc();
  8. 8. Код. MessageProcessor.(MessageQueue + ThreadPool).
  9. 9. Код. FakeProcessor.voidQueue(Task*msg){ msg->Process();}
  10. 10. Код.TrivialProcessor.CircularBuffer + Mutex + ThreadPool
  11. 11. Код. bufferTrivialProcessor. 0 1CircularBuffer deleter 2 - used 3 - used + 4 - used Mutex inserter 5 + ... 2^n ThreadPool
  12. 12. Код.LockFreeProcessor. CircularBuffer + Magic + ThreadPool
  13. 13. Код.LockFreeProcessor.old = Increment(&inserter) - 1;old &= mask;if(0 != CompareExchange( &_array[old], newVal, 0)){ /* !!! */}
  14. 14. Код.MpscProcessor.n x MpscQueue + ThreadPool + rand() % n
  15. 15. Код.MpscProcessor.i = rand() % n;queues[i].Push(msg);
  16. 16. Результат.
  17. 17. Результат.
  18. 18. Результат.
  19. 19. Результат.
  20. 20. За децентрализацию!!!
  21. 21. Всемспасибо!!!

×