- 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.
- 程序員面試白皮書
- 微服務(wù)與事件驅(qū)動(dòng)架構(gòu)
- R語(yǔ)言數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南
- Java 9 Programming Blueprints
- C#程序設(shè)計(jì)(慕課版)
- NativeScript for Angular Mobile Development
- Instant QlikView 11 Application Development
- EPLAN實(shí)戰(zhàn)設(shè)計(jì)
- Web程序設(shè)計(jì)(第二版)
- Scala程序員面試算法寶典
- Oracle 18c 必須掌握的新特性:管理與實(shí)戰(zhàn)
- 微服務(wù)從小白到專家:Spring Cloud和Kubernetes實(shí)戰(zhàn)
- Babylon.js Essentials
- Service Mesh實(shí)戰(zhàn):基于Linkerd和Kubernetes的微服務(wù)實(shí)踐
- Oracle GoldenGate 12c Implementer's Guide