Asynchronous Programming in Python /
In this course, we will look at using asynchronous programming in Python: the options, pitfalls, and best practices. We start with multi-threading, which is particularly useful when there is a lot of waiting, e.g. for HTTP requests or disk access. With multi-threading, you can start many requests in...
Saved in:
Online Access: |
Full text (MCPHS users only) |
---|---|
Format: | Electronic Video |
Language: | English |
Published: |
London, England :
Springer Nature,
2021
|
Subjects: |
Summary: | In this course, we will look at using asynchronous programming in Python: the options, pitfalls, and best practices. We start with multi-threading, which is particularly useful when there is a lot of waiting, e.g. for HTTP requests or disk access. With multi-threading, you can start many requests in quick succession and then wait for all of them to complete at once. Next, the course will show you how to write your code in a thread-safe manner, and how to use it risk-free. Further, it covers Python's global interpreter lock, which prevents a lot of serious problems in Python but also stops you from running threads in parallel. Going forward we discover how you can use Python's multiprocessing library to run functions in parallel. Threads and processes often need to share or exchange data. In asynchronous code just passing Python objects is usually not the safest way to do this. This course looks at the main ways to do this correctly in Python, such as queues and events. Finally, the course moves on to the concurrent.future library which contains higher-level abstractions, including thread and processing pools and an asynchronous map function.The course finishes with advice on how to write robust asynchronous code, and how to test and debug it. |
---|---|
Item Description: | Title from resource description page (viewed April 16, 2021). |
Physical Description: | 1 online resource (87 minutes) |
Playing Time: | 01:26:21 |
Language: | In English. |