当前位置:网站首页>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
边栏推荐
猜你喜欢

Another implementation of lateral view explode

JMeter参数化4种实现方式
软件测试面试题目:请你列举几个物品的测试方法怎么说?
软件测试面试中,面试官问你一些比较“刁难”的问题你会怎么回答

电脑硬件基础知识科普

MySQL event_single event_timed loop event

China to create a domestic "Google Earth" clarity scary

本体开发日记01-Jena配置环境变量

Venture DAO Industry Research Report: Macro and Classic Case Analysis, Model Summary, Future Suggestions

Ovie map computer terminal and mobile terminal can not be used, is there any alternative map tool
随机推荐
2.字节流
接口开发规范及测试工具的使用
Ovie map computer terminal and mobile terminal can not be used, is there any alternative map tool
接口性能测试方案设计方法有哪些?要怎么去写?
Django实现对数据库数据增删改查(二)
8.Properties属性集合
软件测试面试中,面试官问你一些比较“刁难”的问题你会怎么回答
学习双向链表的心得与总结
Web请求原理
字典
自动化测试框架有哪几种?搭建的思路是什么?一篇文章让你彻底了解自动化
Redis high availability
本体开发日记05-努力理解SWRL(Usage Suggestions)
Understanding of PID control motor output as motor PWM duty cycle input
运行flutter项目时遇到的问题修改flutter为国内镜像
测试计划包括哪些内容?目的和意义是什么?
6.Map接口与实现类
恶意软件查杀工具分享
Ontology development diary 02 - simple sparql query
WAVE SUMMIT 2022深度学习开发者峰会