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

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-12-29
  • 2022-01-01
  • 2021-08-19
  • 2018-02-25
  • 2021-12-09
  • 2021-11-23
  • 2021-11-29
猜你喜欢
  • 2022-01-07
  • 2021-12-13
  • 2021-11-28
  • 2018-01-15
  • 2018-07-24
  • 2021-11-13
  • 2018-01-28
  • 2021-11-05
相关资源
相似解决方案