当前位置:网站首页>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
边栏推荐
猜你喜欢
lateral view explode的另一种实现方式
软件测试分析流程及输出项包括哪些内容?
Ovie map computer terminal and mobile terminal can not be used, is there any alternative map tool
A Practical Guide to Building OWL Ontologies using Protege4 and CO-ODE Tools - Version 1.3 (7.4 Annotation Properties - Annotation Properties)
Sweet alert
Ontology development diary 02 - simple sparql query
接口测试的基础流程和用例设计方法你知道吗?
.ts 音频文件转换成 .mp3 文件
软件测试面试思路技巧和方法分享,学到就是赚到
使用Protege4和CO-ODE工具构建OWL本体的实用指南-1.3版本(7.4 Annotation Properties-注释属性)
随机推荐
WAVE SUMMIT 2022深度学习开发者峰会
软件测试面试思路技巧和方法分享,学到就是赚到
你一定要看的安装及卸载测试用例的步骤及方法总结
3.List接口与实现类
2.字节流
【机器学习】网络爬虫实战详解
接口设计
年薪40W测试工程师成长之路,你在哪个阶段?
使用Protege4和CO-ODE工具构建OWL本体的实用指南-1.3版本(7.4 Annotation Properties-注释属性)
JMeter初探五-配置元件与参数化
测试用例的原则、缺陷报告怎么写你都知道吗?
8.递归遍历和删除案例
通用的测试用例编写大全(登录测试/web测试等)
Read file by byte and character_load configuration file
7.Collections工具类
7.FileFilter接口
Jfinal loading configuration file principle
6.Map接口与实现类
白盒测试的概念、目的是什么?及主要方法有哪些?
字典