In the world of multi-core programming, traditional parallel programming techniques with locks (mutexes and similar mechanisms) create performance bottlenecks. Lockless programming is a set of techniques employing atomic operations to synchronize data exchange between threads. The talk introduces the audience to the lockless programming, presents its benefits and pitfalls. The presenter will talk about support for atomic operations in different CPU families as well as support for them in lower- and higher-level languages. He will also cover reordering and memory barriers. He will end the talk with tips on designing lockless algorithms and practical examples of lockless data structures.
Tomasz Barański - Tomasz Barański is a software developer working in Kraków for IBM T.J. Watson Research on projects related to High-Performance computing. He has got over 12 years experience in enterprise world, taking roles of a developer, tester, interaction designer and a go-to guy.
19. acqiure lock
read X
read Y
(…)
store Y
store X
release lock
acqiure lock
read Y
(…)
store X
(...)
read X
(...)
store Y
release lock
reordering
compiler
(JVM)
CPU
22. Sequential consistency
All threads (on all CPUs) agree on order of all
memory operations, and the order is consistent
with the operations order in the source code.