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

261
-1

Published on

Published in: Technology, Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
261
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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. Всемспасибо!!!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×