上一篇文章阐述了进程的基本信息,本文主要介绍进程的实现,主要内容:

  1. 进程表(Process Table or Process Control Blocks)
  2. 中断处理(Interrupt)

一、进程表

操作系统以数组的形式维护了一个进程表,每个进程有一个入口,示意图如下图所示。针对每一个进程,进程表中保存着进程的状态、程序计数器(PC)、指向栈的指针、进程对应内存的地址等等。

上图中的Scheduler会处理外部的中断以及对于进程的调度。

当进程的状态有Running切换为Ready或者Blocked时,进程的所以数据都应该被正确的保存,从而当再次运行时候进程能够像从来没有被停止过一样继续运行。

二、中断处理

2.1 中断示意

上一篇文章就说了一个CPU同一时间只能运行一个进程,但是用户却有电脑同时运行很多进程的假象。上一篇文章的解释是CPU会调度,让不同的进程轮流在CPU上进行运行。这个调度在操作系统中是通过中断来实现的。比如用户正在用Word进行编辑,突然有一封邮件到达了,这个时候操作系统会产生一个中断,该中断最终会让CPU开始运行Email进程。

2.2 中断处理

上面的示意图中Word Process的状态从Running变为了Ready。等Email处理完成,CPU最终还会回到Word进程,Word进程会再次运行,上面说了当再次运行时,Word进程应该如同没有被停止过一样,如何做到?这里最主要的就是在中断发生后对当前运行进程的数据以及状态的保存。

基本流程:

Operating System-Process(2)进程表&&中断处理的更多相关文章

  1. [Chapter 3 Process]Practice 3.3 Discuss three major complications that concurrent processing adds to an operating system.

    3.3  Original version of Apple's mobile iOS operating system provied no means of concurrent processi ...

  2. book-rev8 Chapter 0 Operating system interfaces

    Chapter 0 第0章 Operating system interfaces 操作系统接口 The job of an operating system is to share a comput ...

  3. osquery An Operating System Instrumentation Framewor

    catalog . Getting Started . install guide for OS X and Linux . Features Overview . Logging . query e ...

  4. POJ #2448 A New Operating System

    Time Limit: 20000MS   Memory Limit: 65536K Total Submissions: 1165   Accepted: 110 Case Time Limit: ...

  5. 如何定位“Operating system error 32(failed to retrieve text for this error. Reason: 15105)”错误中被占用的文件

      之前在这篇"Operating system error 32(failed to retrieve text for this error. Reason: 15105)"博 ...

  6. Operating system error 32(failed to retrieve text for this error. Reason: 15105)

    一台数据库服务器的事务日志备份作业偶尔会出现几次备份失败的情况,具体的错误信息为: DATE/TIME:    2018/7/30 12:10:52 DESCRIPTION: BackupDiskFi ...

  7. How to Make a Computer Operating System

    How to Make a Computer Operating System 如何制作一个操作系统(翻译版) 原文地址:Github:How to Make a Computer Operating ...

  8. InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法

    InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法 140628  8:10:48 [Note] Plugi ...

  9. Modern Operating System

    No one can do all things, learn to be good at use what others already did. Most computers have two m ...

  10. Operating system management of address-translation-related data structures and hardware lookasides

    An approach is provided in a hypervised computer system where a page table request is at an operatin ...

随机推荐

  1. [T-SQL] 获取拼音

    )) ) as begin ) ) declare @i int declare @words_len int declare @unicode int set @words = ltrim(rtri ...

  2. C# 6.0 (C# vNext) 新功能之:Null-Conditional Operator(转)

    Null-Conditional Operator 也叫 Null propagating operator 也叫 Safe Navigation Operator 看名字,应该就有点概念了.如果还不 ...

  3. python的进程和线程

    关于进程: An executing instance of a program is called a process.程序的执行实例称为进程. Each process provides the ...

  4. Meeting-in-the-Middle (LA 2965)

    Meeting-in-the-Middle,又称“中途相遇法”.准确地说,它只是一种策略. 顺便说一下,这个算法真的很冷门! 结合这道题来讨论一下吧:LA 2965.ε(┬┬﹏┬┬)3 因为博主的英文 ...

  5. cocos2d-x 源代码分析 : control 源代码分析 ( 控制类组件 controlButton)

    源代码版本号来自3.1rc 转载请注明 cocos2d-x源代码分析总文件夹 http://blog.csdn.net/u011225840/article/details/31743129 1.继承 ...

  6. Advanced GET 9.1 修正汉化版(免注册、页面加载、保存都正常)

    http://www.55188.com/viewthread.php?tid=2846679 Advanced GET 9.1 修正汉化版(免注册.页面加载.保存都正常) 网上流传的很多GET9.1 ...

  7. Java基础教程:多线程基础(1)——基础操作

    Java:多线程基础(1) 实现多线程的两种方式 1.继承Thread类 public class myThread extends Thread { /** * 继承Thread类,重写RUN方法. ...

  8. PHP数组各种操作与函数汇总

    对于Web编程来说,最重要的就是存取和读写数据了.存储方式可能有很多种,可以是字符串.数组.文件的形式等.数组,可以说是PHP的数据应用中较重要的一种方式.PHP的数组函数众多,下面是我学习的小结,借 ...

  9. oc中的blocks的功能,一种比代理简洁的方式

    blocks方式: 谁要东西谁就要写blocks,通过blocks(返回值)获取想要的,提供东西的人要通过实现函数指针把东西给想要的人.当然也可以传值,传值需要通过形参. block的功能: bloc ...

  10. PHP操作MySQL事务处理

    PHP操作MySQL事务处理 /*************** 用begin,rollback,commit来实现 ***************/ /*方法二*/ $conn = mysqli_co ...