- Mastering Concurrency in Python
- Quan Nguyen
- 196字
- 2021-06-10 19:24:00
Working with Threads in Python
In Chapter 1, Advanced Introduction to Concurrent and Parallel Programming, you saw an example of threads being used in concurrent and parallel programming. In this chapter, you will be introduced to the formal definition of a thread, as well as the threading module in Python. We will cover a number of ways to work with threads in a Python program, including activities such as creating new threads, synchronizing threads, and working with multithreaded priority queues, via specific examples. We will also discuss the concept of a lock in thread synchronization, and we will implement a lock-based multithreaded application, in order to better understand the benefits of thread synchronization.
The following topics will be covered in this chapter:
- The concept of a thread in the context of concurrent programming in computer science
- The basic API of the threading module in Python
- How to create a new thread via the threading module
- The concept of a lock and how to use different locking mechanisms to synchronize threads
- The concept of a queue in the context of concurrent programming, and how to use the Queue module to work with queue objects in Python
- Learn Blockchain Programming with JavaScript
- Qt 5 and OpenCV 4 Computer Vision Projects
- 新一代通用視頻編碼H.266/VVC:原理、標準與實現
- UML 基礎與 Rose 建模案例(第3版)
- 微服務架構深度解析:原理、實踐與進階
- Canvas Cookbook
- Emgu CV Essentials
- Python Data Science Cookbook
- 大學計算機基礎實驗指導
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- ASP.NET開發寶典
- Web前端測試與集成:Jasmine/Selenium/Protractor/Jenkins的最佳實踐
- Python無監督學習
- 用Python動手學統計學
- Building Microservices with Go