当前位置:网站首页>1. Introduction to threads
1. Introduction to threads
2022-08-09 09:32:00 【come here my bear】
program, thread, process
Overview
**Program:** A program is an ordered collection of instructions and data, which itself has no meaning of running, and is a static concept
**Process (Process): **Process is an execution process of executing a program and is a dynamic concept.is the unit of system resource allocation
**Thread (Thread): **Thread is an independent execution path and a unit of CPU scheduling and execution
Note:
- Usually a process can contain several threads. Of course, there is at least one thread in a process, otherwise there is no meaning to save.
- Many multi-threading is simulated, real multi-threading refers to having multiple CPUs, that is, multi-core, such as servers
- If it is a simulated multi-threading, that is, in the case of one cpu, at the same time point, the cpu can only execute one code, because the switching is very fast, so there is the illusion of simultaneous execution
Summary
- Threads are independent execution paths
- When the program is running, even if there is no thread created by itself, there will be multiple threads in the background, such as the main thread and the gc thread
- main() is called the main thread, the entry point of the bit system, used to execute the entire program
- In a process, if multiple threads are opened up, the running of the threads is scheduled by the scheduler. The scheduler is related to operating system secrets, and the sequence cannot be interfered by human beings
- When operating on the same resource, there will be a problem of resource grabbing, and concurrency control needs to be added
- Threads will bring additional overhead, such as cpu scheduling time, concurrency control overhead
- Each thread interacts in its own working memory, improper memory control will cause data inconsistency
边栏推荐
- JS报错-Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on...
- .ts 音频文件转换成 .mp3 文件
- 真·鸡汤文
- Jfinal loading configuration file principle
- Teach you how to get a 0.1-meter high-precision satellite map for free
- Lecture 4 SVN
- 本体开发日记05-努力理解SWRL(RDF Concrete Syntax)
- 约瑟夫问题的学习心得
- 接口测试主要测试哪方面?需要哪些技能?要怎么学习?
- 本体开发日记05-努力理解SWRL(上)
猜你喜欢
随机推荐
恶意软件查杀工具分享
米斗APP逆向分析
2.线程创建
2.Collection接口
接口测试的概念、目的、流程、测试方法有哪些?
A Practical Guide to Building OWL Ontologies using Protege4 and CO-ODE Tools - Version 1.3 (7.4 Annotation Properties - Annotation Properties)
A first look at the code to start, Go lang1.18 introductory refining tutorial, from Bai Ding to Hongru, the first time to run the golang program EP01
银联最新测试工程师笔试题目,你能得多少分?
选择黑盒测试用例设计方法的综合策略方案总结
Rights management model, ACL, RBAC and ABAC (steps)
JS报错-Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on...
软件测试外包公司怎么样?有什么好处和坏处?为什么没人去?
WAVE SUMMIT 2022深度学习开发者峰会
4.泛型和工具类
Max Flow P
QT sets the icon of the exe executable
makefile学习-解决目标文件输出路径问题
Swap swap partition
一篇文章让你彻底搞懂关于性能测试常见术语的定义
记录一次被入侵5900端口经历





