当前位置:网站首页>进程和线程的区别
进程和线程的区别
2022-07-07 06:48:00 【wrdoct】
进程和线程的区别
进程:
一个在内存中运行的应用程序。
每个进程都有自己独立的一块内存空间,一个进程可以有多个线程。
线程:
进程中的一个执行任务(控制单元),负责当前进程中程序的执行。
一个进程至少有一个线程,一个进程可以运行多个线程,多个线程可共享数据。
根本区别:进程是操作系统进行资源分配的基本单位,线程是独立调度的基本单位。
地址空间:进程包含独立的地址空间,线程没有自己独立的地址空间,它共享所属进程的空间。
资源:系统在运行的时候会为每个进程分配资源,而不会为线程分配资源,线程所使用的资源来自其所属进程的资源。
开销:进程之间的切换会有较大的开销,线程之间的切换的开销比较小;创建一个线程比进程开销小。
通信:线程之间通信比进程之间通信更方便。
包含关系:线程是一个轻量级进程,是进程的一部分。
影响关系:一个进程崩溃后,在保护模式下不会对其他进程产生影响,但是一个线程崩溃整个进程都死掉。所以多进程要比多线程健壮。
边栏推荐
- (3/8) method parameters of improper use of enumeration (2)
- How to speed up video playback in browser
- 超十万字_超详细SSM整合实践_手动实现权限管理
- Do you have any certificates with high gold content?
- Cesium load vector data
- Self awakening from a 30-year-old female programmer
- C language pointer (Part 2)
- Unity uses mesh to realize real-time point cloud (I)
- PMP Exam Preparation experience, seek common ground while reserving differences, and successfully pass the exam
- Where is the answer? action config/Interceptor/class/servlet
猜你喜欢

stm32和电机开发(从单机版到网络化)

Regular matching starts with XXX and ends with XXX

Selenium mouse sliding operation event

Variable parameter of variable length function

12、 Sort

PMP Exam Preparation experience systematically improve project management knowledge through learning

華為HCIP-DATACOM-Core_03day

PMP Exam details after the release of the new exam outline

Unity shader (learn more about vertex fragment shaders)

Full link voltage test of the e-commerce campaign Guide
随机推荐
Mysql database index study notes
JVM garbage collection detailed learning notes (II)
Storage of data in memory
[cloud native] Devops (I): introduction to Devops and use of code tool
MySql数据库-索引-学习笔记
How long does the PMP usually need to prepare for the exam in advance?
JVM 内存结构 详细学习笔记(一)
Information Security Experiment 1: implementation of DES encryption algorithm
Selenium mouse sliding operation event
Entity of cesium data visualization (Part 1)
Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
网易云微信小程序
华为HCIP-DATACOM-Core_03day
十二、排序
Schema-validation: wrong column type encountered in column XXX in table XXX
shake数据库中怎么使用Mongo-shake实现MongoDB的双向同步啊?
Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
PMP Exam details after the release of the new exam outline
DRF defines views and routes
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme