Fabian Schindler
Concurrency in Python
#1about 4 minutes
Defining concurrency, parallelism, and multitasking
Key terms like concurrency, parallelism, cooperative multitasking, and preemptive multitasking are defined to build a foundational understanding.
#2about 3 minutes
Weighing the benefits and complexity of multitasking
Multitasking can improve performance and reduce costs, but it introduces complexity, non-determinism, and is limited by Amdahl's Law.
#3about 5 minutes
Understanding the differences between processes and threads
Processes are isolated with higher overhead, while threads are lightweight and share memory, with examples using Python's `threading` and `multiprocessing` modules.
#4about 1 minute
Simplifying concurrency with executor pools
The `concurrent.futures` module provides a high-level interface with `ThreadPoolExecutor` and `ProcessPoolExecutor` to easily apply a function to multiple data items.
#5about 5 minutes
How to prevent data corruption with locks
Race conditions occur when multiple threads access shared data simultaneously, which can be prevented by using a mutex or `threading.Lock` to ensure exclusive access.
#6about 2 minutes
How Python's global interpreter lock affects multithreading
The GIL is a mutex that protects access to Python objects, preventing multiple native threads from executing Python bytecodes at the same time and impacting CPU-bound tasks.
#7about 4 minutes
Overcoming thread limitations with event-driven programming
The C10k problem highlights the inefficiency of a thread-per-client model, leading to event-driven solutions like asynchronous programming to handle many concurrent connections.
#8about 5 minutes
Writing concurrent code with async and await
Python's `async` and `await` keywords enable cooperative multitasking, allowing you to run many tasks concurrently on a single thread using an event loop from the `asyncio` module.
#9about 2 minutes
Building high-performance web services with Starlette
The Starlette web framework demonstrates how `asyncio` can be used to build highly concurrent web servers capable of handling many clients efficiently.
#10about 2 minutes
Q&A on Python's speed and choosing thread counts
Answers to common questions address Python's perceived slowness by working around limitations like the GIL and explain that benchmarking is key to finding the optimal number of threads.
Related jobs
Jobs that call for the skills explored in this talk.
envelio
Köln, Germany
Remote
Senior
Python
Software Architecture
Matching moments
04:10 MIN
The evolution from threads to modern concurrency
Concurrency with Go
03:01 MIN
Explaining multiprocessing and multithreading with analogies
Devouring APIs with Python
05:30 MIN
Concurrency as a natural model for software design
Concurrency with Go
07:14 MIN
Q&A on concurrency models and developer tools
Devouring APIs with Python
02:30 MIN
Achieving high performance with async support
Intro to FastAPI
04:35 MIN
Concurrency support from memory models to coroutines
The Design and Evolution of C++
02:27 MIN
Moving from concurrency to true parallelism
Multithreading in Javascript: A guide to Web Workers
06:56 MIN
How coroutines fit into modern threading models
Coroutine explained yet again 60 years later
Featured Partners
Related Videos
Accelerating Python on GPUs
Paul Graham
CUDA in Python
Andy Terrel
Devouring APIs with Python
Shweta Palande
Python: Behind the Scenes
Diana Gastrin
Python-Based Data Streaming Pipelines Within Minutes
Bobur Umurzokov
Exploring Durable Execution with Python
Geetha Anne
Vectorize all the things! Using linear algebra and NumPy to make your Python code lightning fast.
Jodie Burchell
Anvil: Full Stack Web Apps With Nothing But Python
Meredydd Luff
Related Articles
View all articles.gif?w=240&auto=compress,format)



From learning to earning
Jobs that call for the skills explored in this talk.

Code Healers LLC
Hinesville, United States of America
Remote
€40-50K
Intermediate
Senior
PHP
.NET
React
+2

ACONEXT Stuttgart GmbH
München, Germany
Remote
API
GIT
Python
Test Case Design
+2

Talents It
Canton de Levallois-Perret, France
Remote
€45-55K
Intermediate
GIT
Linux
Nginx
+6


Client Server
Charing Cross, United Kingdom
Remote
£85-100K
Linux
Python
Docker
+6

TrinIT Group
Woking, United Kingdom
£104K
API
JIRA
JSON
Python
+3

IMS Nanofabrication GmbH
Vienna, Austria
€55K
GIT
Linux
Python
Docker
+4

Client Server
Charing Cross, United Kingdom
Remote
£80-95K
Azure
PostgreSQL
Microsoft SQL Server
+1

Procode Technology Limited
Chandler's Ford, United Kingdom
£39K
Scrum
DevOps
Python
Grafana
+6