当前位置:网站首页>任务、线程、进程 区别
任务、线程、进程 区别
2022-07-01 08:31:00 【匠在江湖】
在多数通用(分时)操作系统(如Linux,Windows)中,常听说线程、进程名词。而在多数实时操作系统(RTOS)(如uCOS,FreeRTOS)中,常听说是任务。它们到底有啥区别和联系呢!看下文。
概念
进程(Process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在当代面向线程设计的计算机结构中,进程是线程的容器。程序是指令、数据及其组织形式的描述,进程是程序的实体。
线程(英语:thread)是操作系统能够进行运算调度的最小单位。它被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程并行执行不同的任务。
任务是指人们在日常生活、工作、娱乐活动中所从事的各种各样有目的的活动。在现代计算机中,“任务”也是基本工作单位,在多数实时操作系统(如uCOS,FreeRTOS)中,是实时操作系统 进行运算调度的最小单位。
通俗理解
举例说明:如果把计算机的操作系统比作一个大的工厂。进程就是工厂中的各个相互独立的车间,线程则是车间中的流水线工人。每个车间中至少有一个工人,也可以有多个工人。这些“工人”共享着这个车间中的所有资源。
像在FreeRTOS中,任务与线程的含义一致,都是 操作系统 进行运算调度的最小单位。在FreeRTOS上跑的整个程序即为一个进程,该进程中又包含着多个线程(任务),这些线程有些是系统自动创建的,有些为用户手动创建。
边栏推荐
猜你喜欢

shardingSphere

Suivi des cibles de manoeuvre - - mise en oeuvre du modèle statistique actuel (modèle CS) filtre Kalman étendu / filtre Kalman sans trace par MATLAB

《单片机原理及应用》—定时器、串行通信和中断系统

Guidelines and principles of did
![[JS reverse] MD5 encryption parameter cracking](/img/06/0610045d287f646479d6eb5021a067.png)
[JS reverse] MD5 encryption parameter cracking

Pipeline detection of UAV Based on gazebo

性能提升2-3倍!百度智能云第二代昆仑芯服务器上线

Share 7 books I read in the first half of 2022

【华为机试真题详解】判断字符串子序列【2022 Q1 Q2 | 200分】

你了解数据是如何存储的吗?(C整型和浮点型两类)
随机推荐
vscode自定义各个区域的颜色
Brief introduction to AES
SPL-介绍(一)
《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断
The use of word in graduation thesis
Leetcode t39: combined sum
Manually dig XSS vulnerabilities
How to use OKR as the leadership framework of marketing department
When using charts to display data, the time field in the database is repeated. How to display the value at this time?
View drawing process analysis
嵌入式工程师常见面试题2-MCU_STM32
There are many problems in sewage treatment, and the automatic control system of pump station is solved in this way
Introduction to 18mnmo4-5 steel plate executive standard and delivery status of 18mnmo4-5 steel plate, European standard steel plate 18mnmo4-5 fixed rolling
机动目标跟踪——当前统计模型(CS模型)扩展卡尔曼滤波/无迹卡尔曼滤波 matlab实现
Provincial election + noi Part III tree problems
The meaning of yolov5 training visualization index
The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
MATLAB小技巧(23)矩阵分析--模拟退火
[untitled]
Share 7 books I read in the first half of 2022