- 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.
- Java語言程序設計
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Microsoft Application Virtualization Cookbook
- 自己動手寫Java虛擬機
- Vue.js快跑:構建觸手可及的高性能Web應用
- Java加密與解密的藝術
- Mastering Python Networking
- Android Wear Projects
- Java Web開發就該這樣學
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- ScratchJr趣味編程動手玩:讓孩子用編程講故事
- 前端架構設計
- LabVIEW數據采集(第2版)
- 計算機輔助設計與繪圖技術(AutoCAD 2014教程)(第三版)
- Developing RESTful Web Services with Jersey 2.0