当前位置:网站首页>线程和进程
线程和进程
2022-06-28 09:19:00 【李王家的翠花】
一、定义
进程:进程是指在系统中正在运行的一个应用程序。每个进程之间是独立的,每个进程均运行在其专用的且受保护的内存中,进程是系统进行资源分配和调度的一个独立单位。
线程:线程是进程的基本执行单元,一个进程的所有任务都在线程中执行。是CPU调度和分派的基本单位。程序启动会默认开启一条线程,这条线程被称为主线程或 UI 线程。
二、联系
进程要想执行任务,必须得有线程。同一进程的线程共享本进程的地址空间,同一进程内的线程共享本进程的资源。
三、区别
线程不能够独立执行,必须依存在应用程序中,由应用程序提供多个线程执行控制。多线程就是同一进程中有多个执行部分可以同时执行,来实现进程的调度和管理以及资源分配。
注:更新完JVM系列后会从内存的角度详细介绍两者区别。
边栏推荐
- Stock suspension
- Ingersoll Rand panel maintenance IR Ingersoll Rand microcomputer controller maintenance xe-145m
- Do static code blocks always execute first? The pattern is smaller!!!
- Implementation of single sign on
- 数据挖掘建模实战
- 01 distributed system overview
- RESTful风格
- Using transform:scale causes the page mouse hover event to disappear
- Apache Doris 成为 Apache 顶级项目
- Summary of PMP learning experience
猜你喜欢

Virtual machine 14 installing win7 (Figure tutorial)

虚拟机14安装win7(图教程)

自动转换之-面试题

图解MySQL的binlog、redo log和undo log

redis5.0的槽点迁移,随意玩(单机迁移集群)

Why does select * lead to low query efficiency?

Common test method used by testers --- orthogonal method

数据挖掘建模实战

Illustration of MySQL binlog, redo log and undo log

Write a simple timeline
随机推荐
Basic knowledge of hard disk (head, track, sector, cylinder)
Apache Doris becomes the top project of Apache
How do I open an account on my mobile phone? Is it safe to open an account online now?
Postman interface test
Do static code blocks always execute first? The pattern is smaller!!!
1182:合影效果
Assertions used in the interface automation platform
Android studio interview preparation
Apiccloud, together with 360 Tianyu, helps enterprises keep the "first pass" of APP security
SQL注入之文件读写
Application of energy management system in iron and steel enterprises
Implement global double finger long press to return to the desktop
虛擬機14安裝win7(圖教程)
理解IO模型
详解final、finally和finalize
Scenario method and error recommendation method for learning basic content of software testing (2)
Importerror: no module named image [duplicate] - importerror: no module named image [duplicate]
从知识到智慧:知识图谱还要走多远?
手机炒股开户安不安全?
Common test method used by testers --- orthogonal method