Ultimate Python
/
Python Versions
Fundamentals(11)
  • Variable
  • Expression
  • String
  • List
  • Tuple
  • Set
  • Dict
  • Conditional
  • Loop
  • Function
  • Comprehension
OOP(11)
  • Basic Class
  • Dataclass
  • Inheritance
  • Encapsulation
  • Property
  • Enum
  • Abstract Class
  • Exception Class
  • Iterator Class
  • Mixin
  • Mro
Data Structures(5)
  • Deque
  • Namedtuple
  • Ordereddict
  • Defaultdict
  • Heap
Standard Library(5)
  • File Handling
  • Regex
  • Data Format
  • Date Time
  • Itertools
Advanced(9)
  • Decorator
  • Context Manager
  • Meta Class
  • Weak Ref
  • Walrus Operator
  • Arg Enforcement
  • Dict Union
  • Pattern Matching
  • Template Strings
Concurrency(4)
  • Thread
  • Process
  • Async
  • Subinterpreters
Engineering(5)
  • Mocking
  • Benchmark
  • Memory Profile
  • Logger
  • Bitwise

No matching lessons found

Chapter4 Lessons

Concurrency

Multitasking and asynchronous execution models. Understand thread synchronization, non-blocking coroutines with asyncio Task Groups, and isolated subinterpreters.

Start Chapter: Thread

Chapter Lessons

01

Thread

Threaded programming is used by developers to improve the performance of an application. This module shows how a multiplication operation with some delay can be parallelized using `ThreadPoolExecutor`.

View Code
02

Process

Process-based parallelism via multiprocessing and concurrent.futures.

View Code
03

Async

Python 3.11

Concurrent programming with asyncio, introduced in Python 3.4, provides an event loop for handling asynchronous operations. This module demonstrates basic asyncio patterns including coroutines, tasks, concurrent execution with gather, and task cancellation. It uses the context of a scheduler which runs fire-and-forget operations for starting jobs, assuming that job startup has some intrinsic delay.

View Code
04

Subinterpreters

Python 3.14

Multi-interpreter support via concurrent.interpreters in Python 3.14 (PEP 734).

View Code
Previous ChapterAdvancedNext ChapterEngineering