当前位置:网站首页>进程和线程的区别
进程和线程的区别
2022-07-28 05:27:00 【小 乔】
- 进程是包含线程的,一个进程可以包含一个或多个线程,多个线程之间共享同一块内存资源;
- 线程比进程更轻量,创建出来的新线程和之前的线程共享同一个内存资源;
- 进程是操作系统进行资源分配的最小单位,线程是操作系统进行调度执行的最小单位;
- 操作系统创建每个进程都会给这个进程分配一定的内存空间(虚拟地址空间),还会给这个进程创建一个文件描述符表(这个进程当前都开了哪些文件),当前进程中的这些线程都是共享了这俩部分资源;线程之间有独立的程序计数器以及栈空间;
- 如果一个进程挂了,不会影响到其他进程;如果一个线程挂了,可能会导致整个进程异常终止,同进程内的其他线程也就一起被带走了。
边栏推荐
- AQS之ReentrantLock源码解析
- [pta-- use queues to solve the problem of monkeys choosing kings]
- SSAO By Computer Shader(三)
- rancher部署实战
- Development of Quantitative Trading Robot System
- Feignclient @requestmapping parameter setting and simple method setting of request header
- elastic常用高频命令
- Graphic pipeline foundation (I)
- [PTA----输出全排列]
- 从普通查询商品到高并发查询商品的优化思路
猜你喜欢

Water drop effect on umbrella

mongo ssl 配置实战

Graphic pipeline foundation (II)

江中ACM新生10月26日习题题解

redis缓存设计与性能优化

What is hash? (development of Quantitative Trading Robot System)

Leetcode 刷题日记 剑指 Offer II 055. 二叉搜索树迭代器
![[dynamic planning -- the best period for buying and selling stocks Series 2]](/img/6c/887a026d3c1bcbd278bb7f3e0afd05.png)
[dynamic planning -- the best period for buying and selling stocks Series 2]

archery数据库审核平台部署

如何描述一个BUG以及BUG级别的定义、生命周期
随机推荐
archery数据库审核平台部署
Skimming records -- sequence traversal of binary tree
网络——数据链路层
OJ 1045 reverse and add
浅谈Cookie和Session
关于时间复杂度,你不知道的都在这里
【动态规划--买卖股票的最佳时期系列】
Question skimming record - hash table
@Postconstruct annotations and useful examples
Battle plague Cup -- strange shape
[dynamic planning -- the best period for buying and selling stocks series 3]
OJ 1131 beautiful number
战疫杯--我的账本
OJ 1129 fraction matrix
[c language] - step by step to achieve minesweeping games
OJ 1242 大一上之初出茅庐
图形管线基础(一)
【动态规划--买卖股票的最佳时期系列3】
Array solution script
Water drop effect on umbrella