当前位置:网站首页>进程与线程的区别与联系
进程与线程的区别与联系
2022-08-07 09:14:00 【亲爱的小杰】
进程与线程的区别与联系
什么是进程?
进程是一个程序运行时,完成一系列任务的模样。
我们说创建进程和销毁进程,效率是比较低的。为了解决这一问题,我们引进了线程这一概念。
我们可以把线程理解为“轻量级的进程”。
进程与线程的区别与联系:
(1)进程包含线程,也就是说线程在进程的里面。
(2)进程有自己的虚拟地址空间和文件描述符表。而在同一个进程里的线程,则是公用相同的虚拟地址空间和文件描述符表。
(3)进程是操作系统资源分配的基本单位。而线程是操作系统调度的基本单位。
(4)进程与进程间是相互隔离的,也就是说一个进程要是出了问题,其他进程一般是没有什么影响的。而在同一个进程里的线程要是出了问题,其他线程一般是会收到影响,进而导致该进程出现问题。
边栏推荐
猜你喜欢

#yyds干货盘点#【愚公系列】2022年08月 Go教学课程 004-Go代码注释

Go语言的其他高级特性

leetcode 26. 删除有序数组中的重复项(实现unique函数)

(一)UPF之电源网络(Supply_port、Supply_net、Supply_set)

window.requestAnimationFrame Web3D rendering frame rate control

In-depth analysis of Spark SQL illustrates the execution process and application scenarios of five Join strategies

MES生产管理系统是什么?有ERP系统了为什么还要上

【Go】(1)go语言开发环境配置

The baud rate of STM32 is wrong. The baud rate we want to set is 9600, but the actual baud rate is 14400. Why is this?
![LeetCode [206. Reverse linked list] (1)](/img/c1/57528ae0c72179710c2a76f782f658.png)
LeetCode [206. Reverse linked list] (1)
随机推荐
[C language] Tower of Hanoi
openharmony new contribution guide
数据可视化(三)
3D~RPG游戏的制作
Arthas use error
The baud rate of STM32 is wrong. The baud rate we want to set is 9600, but the actual baud rate is 14400. Why is this?
[Go] (1) Go language development environment configuration
E-commerce data warehouse notes 1 (data warehouse concept, project requirements and architecture design, data generation module)
TikTok本周动态,TikTok Shop新加坡首场大促将于本月举行
Principle of redis and source - redis data types of coding formats and data structures, a list, dict, SDS zskiplist, intset, ziplist, quicklist, listpack, rax, stream
LeetCode #100. 相同的树
30.01 C/S and TCP/IP protocols are interesting and vivid
redis的原理和源码-基本介绍
Today's sleep quality record 74 points
redis的原理和源码-sentinel哨兵的原理和源码解析(下)
redis的原理和源码-主从复制的原理介绍
php怎么判断目录下有几个文件
思维和方法:冯诺依曼代码分析法:高效阅读理解和写代码
【正点原子STM32连载】第五章 STM32基础知识入门 摘自【正点原子】MiniPro STM32H750 开发指南_V1.1
The principle and source code of redis - three common problems of caching (cache penetration, cache breakdown, cache avalanche)