1 / 25

Behavior of Synchronization Methods in Commonly Used Languages and Systems

Distributed Computing and Systems Chalmers University of Technology Gothenburg, Sweden. Behavior of Synchronization Methods in Commonly Used Languages and Systems. Yiannis Nikolakopoulos ioaniko@chalmers.se Joint work with: D. Cederman, B. Chatterjee, N. Nguyen,

giza
Download Presentation

Behavior of Synchronization Methods in Commonly Used Languages and Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Computing and SystemsChalmers University of TechnologyGothenburg, Sweden Behavior of Synchronization Methods in Commonly Used Languages and Systems Yiannis Nikolakopoulos ioaniko@chalmers.se Joint work with: D. Cederman, B. Chatterjee, N. Nguyen, M. Papatriantafilou, P. Tsigas

  2. Developing a multithreaded application… The boss wants .NET Java is nice Multicores everywhere The client wants speed… (C++?) Yiannis Nikolakopoulosioaniko@chalmers.se

  3. Developing a multithreaded application… Concurrent Data StructuresThen we need Synchronization. The worker threads need to access data Yiannis Nikolakopoulosioaniko@chalmers.se

  4. Implementing Concurrent Data Structures Performance Bottleneck Yiannis Nikolakopoulosioaniko@chalmers.se

  5. Implementing Concurrent Data Structures Runtime System Hardware platform Which is the fastest/most scalable? Yiannis Nikolakopoulosioaniko@chalmers.se

  6. Implementing concurrent data structures Yiannis Nikolakopoulosioaniko@chalmers.se

  7. Problem Statement • How the interplay of the above parameters and the different synchronization methods, affect the performance and the behavior of concurrent data structures. Yiannis Nikolakopoulosioaniko@chalmers.se

  8. Outline Introduction Experiment Setup Highlights of Study and Results Conclusion Yiannis Nikolakopoulos ioaniko@chalmers.se

  9. Which data structures to study? Represent different levels of contention: • Queue - 1 or 2 contention points • Hash table - multiple contention points Yiannis Nikolakopoulosioaniko@chalmers.se

  10. How do we choose implementation? Possible criteria: • Framework dependencies • Programmability • “Good” performance Yiannis Nikolakopoulosioaniko@chalmers.se

  11. Interpreting “good” • Throughput:The more operations completed per time unit the better. • Is this enough? Yiannis Nikolakopoulosioaniko@chalmers.se

  12. Non-fairness Yiannis Nikolakopoulosioaniko@chalmers.se

  13. What to measure? • Throughput:Data structure operations completed per time unit. Average operations per thread Operations by thread i Yiannis Nikolakopoulosioaniko@chalmers.se

  14. Implementation Parameters Programming C++ Java C# (.NET, Mono) Environments TAS, TTAS, Lock - free, Array lock Synchronization PMutex, Reentrant, lock construct, Methods Lock - free memory synchronized M utex management NUMA Intel Nehalem, 2 x 6 core AMD Bulldozer, 4 x 12 core Architectures (24 HW threads) (48 HW threads) Do they influence fairness? Yiannis Nikolakopoulosioaniko@chalmers.se

  15. Experiment Parameters • Different levels of contention • Number of threads • Measured time intervals Yiannis Nikolakopoulosioaniko@chalmers.se

  16. Outline • Queue • Fairness • Intel vs AMD • Throughput vs Fairness • Hash Table • Intel vs AMD • Scalability Introduction Experiment Setup Highlights of Study and Results Conclusion Yiannis Nikolakopoulos ioaniko@chalmers.se

  17. Observations: Queue Fairness can change along different time intervals 24 Threads, High contention Yiannis Nikolakopoulos ioaniko@chalmers.se

  18. Observations: Queue Significantly different fairness behavior in different architectures Fairness 24 Threads, High contention Yiannis Nikolakopoulos ioaniko@chalmers.se

  19. Observations: Queue Significantly different fairness behavior in different architectures Fairness 24 Threads, High contention Lock-free is less affected in this case Yiannis Nikolakopoulos ioaniko@chalmers.se

  20. C++ C++ 1 16 14 0,8 12 10 0,6 8 Operations per ms (thousands) 0,4 6 Fairness 4 0,2 2 0 0 2 4 6 8 12 24 48 2 4 6 8 12 24 48 Threads Threads TTAS Lock-free PMutex Queue: Throughput vs Fairness Fairness 0.6 s, Intel Throughput Yiannis Nikolakopoulos ioaniko@chalmers.se

  21. Observations: Hash table • Operations are distributed in different buckets • Things get interesting when #threads > #buckets • Tradeoff between throughput and fairness • Different winners and losers • Contention is lowered in the linked list components Yiannis Nikolakopoulosioaniko@chalmers.se

  22. Observations: Hash table Fairness differences in Hash table across architectures 24 Threads, High contention Yiannis Nikolakopoulos ioaniko@chalmers.se

  23. Observations: Hash table Fairness differences in Hash table across architectures 24 Threads, High contention Lock-free is again not affected Yiannis Nikolakopoulos ioaniko@chalmers.se

  24. Observations: Hash table In C++, custom memory management and lock-free implementations excel in scalability and performance. Yiannis Nikolakopoulos ioaniko@chalmers.se

  25. Conclusion Which is the fastest/most scalable? • Complex synchronization mechanisms (Pmutex, Reentrant lock) pay off in heavily contended hot spots • Scalability via more complex, inherently parallel designs and implementations • Tradeoff between throughput and fairness • LF Hash table • Reentrant lock vs Array Lock vs LF Queue • Fairness can be heavily influenced by HW • Interesting exceptions Is fairness influenced by NUMA? Yiannis Nikolakopoulos ioaniko@chalmers.se

More Related