PyCon UK 2019

Synchronization Primitives in Python
2019-09-14, 13:00–13:15, Marble Hall

Describing the common problems that arise while doing trivial multi-threaded implementations


Multithreading opens new dimensions for computing, but with power comes responsibility. If the multi-threaded environment of your program isn't well planned, your software might perform worse than its single-threaded version!

In this poster presentation, we first describe the common problems that trivial multi-threaded implementations have - like race conditions. Then we introduce some of the tools of Python's standard library that allow us to execute both concurrency and parallelism in the right way. Some of these synchronization primitives are locks, semaphores, and barriers. We will discuss 6 of these primitives in some detail and describe the cases where they can be used appropriately.

Finally, we'll talk about Python's Global Interpreter Lock (GIL), some of its benefits, nuances and the challenges it brings to building parallel programs in Python. Multi-threading is an arose component of any programming language, and can do performance wonders when implemented the right way because synchrony is harmony!


Is your proposal suitable for beginners? – True