操作系统课程中提到了两个非常重要的概念进程和线程,对此进行一下小结!

1.进程

 概念:通俗的讲进程就是运行着的程序(A program in execution)

 A process is an instance of a computer program, consisting of one or more threads, that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently (Wikipedia)

进程组成:进程控制块、程序段、数据段三部分组成

进程控制块PCB(Process control block)

进程状态(Process states):

新的(new)

运行(running)

等待(waiting)

就绪(ready)

终止(terminated)

 进程(Process)和线程(Thread)

2.线程

概念:线程(thread),有时被称为轻量级进程(Lightweight Process,LWP),是程序执行流的最小单元。

 A thread of execution results from a fork of a computer program into two or more (Wikipedia)

线程组成:线程ID,程序计数器,寄存器集合和堆栈组成

Java中线程创建的两种方法:

1.继承Thread类

2.实现Runnable接口

相关文章:

  • 2021-11-28
  • 2021-04-11
  • 2021-07-28
  • 2021-08-11
  • 2021-04-24
  • 2022-02-19
  • 2021-10-13
  • 2022-03-08
猜你喜欢
  • 2021-05-11
  • 2022-01-07
  • 2021-06-30
  • 2021-08-23
  • 2021-11-19
  • 2022-02-21
  • 2021-12-13
相关资源
相似解决方案