当前位置:网站首页>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
边栏推荐
猜你喜欢
软件测试外包公司怎么样?有什么好处和坏处?为什么没人去?
【机器学习】网络爬虫实战详解
“摄像头用不了”+win8.1+DELL+外置摄像头+USB免驱的解决办法
Django实现对数据库数据增删改查(一)
软件测试面试中,面试官问你一些比较“刁难”的问题你会怎么回答
Ontology Development Diary 01-Jena Configuration Environment Variables
China to create a domestic "Google Earth" clarity scary
常用功能测试的检查点与用例设计思路
软件测试分析流程及输出项包括哪些内容?
Global 19 Google Satellite Map Free View Download
随机推荐
关于一次性通过CISSP考试的一点经验分享
web测试之功能测试常用的方法有哪几种?有什么要点要注意?
Understanding of PID control motor output as motor PWM duty cycle input
WAVE SUMMIT 2022深度学习开发者峰会
本体开发日记05-努力理解SWRL(上)
7.Collections工具类
游戏测试的概念是什么?测试方法和流程有哪些?
年薪40W测试工程师成长之路,你在哪个阶段?
Summary of steps and methods for installing and uninstalling test cases that you must read
Jfinal loading configuration file principle
命令行查询数据库
关于链表的几道大厂面试题
Do you know the basic process and use case design method of interface testing?
本体开发日记05-努力理解SWRL(中)
选择黑盒测试用例设计方法的综合策略方案总结
一篇文章让你彻底搞懂关于性能测试常见术语的定义
JMeter参数化4种实现方式
map去重代码实现
进入大厂的面试经验(P7)
Domestic with Google earth software, see the download 19th level high-resolution satellite images so easy!