- Mastering Concurrency in Python
- Quan Nguyen
- 222字
- 2021-06-10 19:24:01
Threads versus processes
More than one thread can be implemented within the same process, most often executing concurrently and accessing/sharing the same resources, such as memory; separate processes do not do this. Threads in the same process share the latter's instructions (its code) and context (the values that its variables reference at any given moment).
The key difference between the two concepts is that a thread is typically a component of a process. Therefore, one process can include multiple threads, which can be executing simultaneously. Threads also usually allow for shared resources, such as memory and data, while it is fairly rare for processes to do so. In short, a thread is an independent component of computation that is similar to a process, but the threads within a process can share the address space, and hence the data, of that process:
Threads were reportedly first used for a variable number of tasks in OS/360 multiprogramming, which is a discontinued batch processing system that was developed by IBM in 1967. At the time, threads were called tasks by the developers, while the term thread became popular later on and has been attributed to Victor A. Vyssotsky, a mathematician and computer scientist who was the founding director of Digital's Cambridge Research Lab.
- GAE編程指南
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- Visual FoxPro程序設計教程(第3版)
- Learning Data Mining with Python
- Building a Quadcopter with Arduino
- 深入淺出PostgreSQL
- Oracle Exadata專家手冊
- Spring快速入門
- Lighttpd源碼分析
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- Go語言編程
- Python 3.7從入門到精通(視頻教學版)
- Kubernetes進階實戰
- OpenCV 3計算機視覺:Python語言實現(原書第2版)