当前位置:网站首页>进程和线程的区别
进程和线程的区别
2022-07-07 06:48:00 【wrdoct】
进程和线程的区别
进程:
一个在内存中运行的应用程序。
每个进程都有自己独立的一块内存空间,一个进程可以有多个线程。
线程:
进程中的一个执行任务(控制单元),负责当前进程中程序的执行。
一个进程至少有一个线程,一个进程可以运行多个线程,多个线程可共享数据。
根本区别:进程是操作系统进行资源分配的基本单位,线程是独立调度的基本单位。
地址空间:进程包含独立的地址空间,线程没有自己独立的地址空间,它共享所属进程的空间。
资源:系统在运行的时候会为每个进程分配资源,而不会为线程分配资源,线程所使用的资源来自其所属进程的资源。
开销:进程之间的切换会有较大的开销,线程之间的切换的开销比较小;创建一个线程比进程开销小。
通信:线程之间通信比进程之间通信更方便。
包含关系:线程是一个轻量级进程,是进程的一部分。
影响关系:一个进程崩溃后,在保护模式下不会对其他进程产生影响,但是一个线程崩溃整个进程都死掉。所以多进程要比多线程健壮。
边栏推荐
- Colorbar of using vertexehelper to customize controls (II)
- PMP examination experience sharing
- Loxodonframework quick start
- Postman interface test (I. installation and use)
- 4、 Fundamentals of machine learning
- Pycharm create a new file and add author information
- 【SVN】SVN是什么?怎么使用?
- 2020 year end summary
- NVIC interrupt priority management
- Add new item after the outbound delivery order of SAP mm sto document is created?
猜你喜欢
Locust performance test 4 (custom load Policy)
How long does the PMP usually need to prepare for the exam in advance?
华为HCIP-DATACOM-Core_03day
信息安全实验二 :使用X-SCANNER扫描工具
sqlplus乱码问题,求解答
Variable parameter of variable length function
Several stages of PMP preparation study
4、 Fundamentals of machine learning
Systick tick timer
Huawei hcip datacom core_ 03day
随机推荐
PMP Exam details after the release of the new exam outline
Regularly modify the system time of the computer
Run can start normally, and debug doesn't start or report an error, which seems to be stuck
scrapy爬虫mysql,Django等
Unity shader (learn more about vertex fragment shaders)
Leetcode刷题记录(数组)组合总和、组合总和 II
Implementation of corner badge of Youmeng message push
华为HCIP-DATACOM-Core_03day
5A summary: seven stages of PMP learning
Information Security Experiment 2: using x-scanner scanning tool
Install pyqt5 and Matplotlib module
sqlplus乱码问题,求解答
Zen - batch import test cases
liunx命令
2020 year end summary
[SVN] what is SVN? How do you use it?
数据建模中利用3σ剔除异常值进行数据清洗
PMP Exam Preparation experience systematically improve project management knowledge through learning
Unity uses mesh to realize real-time point cloud (II)
Network request process