- 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
- 黑客攻防從入門到精通(實戰秘笈版)
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發經典名著)
- C++案例趣學
- PHP基礎案例教程
- Instant Zepto.js
- HTML5+CSS3基礎開發教程(第2版)
- Java Web開發技術教程
- 你不知道的JavaScript(中卷)
- Getting Started with LLVM Core Libraries
- CoffeeScript Application Development Cookbook
- C++ Fundamentals
- 單片機原理及應用技術
- C編程技巧:117個問題解決方案示例
- Java Hibernate Cookbook
- Java 9 with JShell