技术文章推荐程序员程序员技术栈

Program Thread 和 Process的不同点

2019-03-09  本文已影响6人  V哥的博客

What is Program

Program是一个存在disk中且断电或重启不会消失可执行文件,存储在存储媒介中,以实体文件的形态存在

A program is an executable file residing on the disk (secondary storage) in a directory. It is also termed as a set of instructions stored in the secondary storage device that are intended to carry out a specific job. It is read into the primary memory and executed by the kernel.

本文来自 Abbymz 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/Abby210/article/details/51225034?utm_source=copy

或者可以称之为persistently 的文件,断电也不会消失。

What is Process ?

当program被执行之后,就变成了进程。执行者的权限和程序所需的资料都会载入到内存中,OS会给予这些内存单元一个pid。

Unit of resource ownership (allocation) and unit of protection

text, Code of Programmer
Data
Heap
Stack

一个program可以创建出很多个进程,关机或停电会死掉

Process的组成

What is Thread ?

线程称之为Lightweight Process,一个进程可以有多个线程,他们共享一片内存

Unit of dispatch or unit of execution

多线程的好处

什么叫Multithreading

The ability of an OS to support multiple, concurrent paths of execution within a single process.

Process and thread states

How Deadlock happen ?

Reference

https://slideplayer.com/slide/5219996/


想要看到更多玮哥的学习笔记、考试复习资料、面试准备资料?想要看到IBM工作时期的技术积累和国外初创公司的经验总结?

image

敬请关注:

玮哥的博客 —— CSDN的传送门

玮哥的博客 —— 简书的传送门

玮哥的博客 —— 博客园的传送门

上一篇下一篇

猜你喜欢

热点阅读