西安电子科技大学:《操作系统》课程教学资源(PPT课件)Processes

Processes
Processes

Outline contemporary computer systems allow multiple programs to be loaded into memory and executed concurrently A system therefore consists of a collection of processes (a program in execution):operating system processes executing system code and user processes executing user code. ·Process Concept ·Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server Systems*
Outline • contemporary computer systems allow multiple programs to be loaded into memory and executed concurrently • A system therefore consists of a collection of processes (a program in execution): operating system processes executing system code and user processes executing user code. • Process Concept • Process Scheduling • Operations on Processes • Interprocess Communication • Examples of IPC Systems • Communication in Client-Server Systems*

Process Concept A process is an instance of a program in execution. Batch systems work in terms of "jobs".Many modern process concepts are still expressed in terms of jobs,(e.g.job scheduling ) and the two terms are often used interchangeably
Process Concept • A process is an instance of a program in execution. • Batch systems work in terms of "jobs". Many modern process concepts are still expressed in terms of jobs, ( e.g. job scheduling ), and the two terms are often used interchangeably

The Process Process memory is divided into four sections: max stack The text section comprises the compiled program code,read in from an executable program. The data section stores global and static variables, allocated and initialized prior to executing main. The heap is used for dynamic memory allocation,and is managed via calls to new,delete,malloc,free,etc. The stack is used for function parameters,local heap variables,return addresses. data Current activity including status,program counter, text processor registers,... 0
- The Process • Process memory is divided into four sections: • The text section comprises the compiled program code, read in from an executable program. • The data section stores global and static variables, allocated and initialized prior to executing main. • The heap is used for dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc. • The stack is used for function parameters, local variables, return addresses. • Current activity including status, program counter, processor registers, …

When processes are swapped out of CPU and later restored, additional information must also be stored and restored.Key among them are the program counter and the value of all program registers
• When processes are swapped out of CPU and later restored, additional information must also be stored and restored. Key among them are the program counter and the value of all program registers

Program vs Process Program is passive entity stored on disk (executable file),process is active Program becomes process when a executable file loaded into memory Execution of program started via GUl mouse clicks,command line entry of its name,etc One program can be several processes Consider multiple users executing the same program
Program vs Process • Program is passive entity stored on disk (executable file), process is active • Program becomes process when a executable file loaded into memory • Execution of program started via GUI mouse clicks, command line entry of its name, etc • One program can be several processes • Consider multiple users executing the same program

Process State Processes may be in one of 5 states. New-The process is in the stage of being created. Ready-The process has all the resources available that it needs to run,but the CPU is not currently working on this process's instructions. Running-The CPU is working on this process's instructions. Waiting-The process cannot run at the moment,because it is waiting for some resource to become available or for some event to occur.For example the process may be waiting for keyboard input,disk access request,inter- process messages,a timer to go off,or a child process to finish. Terminated-The process has completed
- Process State • Processes may be in one of 5 states. • New - The process is in the stage of being created. • Ready - The process has all the resources available that it needs to run, but the CPU is not currently working on this process's instructions. • Running - The CPU is working on this process's instructions. • Waiting - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur. For example the process may be waiting for keyboard input, disk access request, interprocess messages, a timer to go off, or a child process to finish. • Terminated - The process has completed

new admitted interrupt exit terminated ready running 1/O or event completion scheduler dispatch 1/O or event wait waiting Figure 3.2-Diagram of process state
Figure 3.2 - Diagram of process state

DEMO Task manager in Windows ·ps,top The load average reported by the "w"command indicate the average number of processes in the "Ready"state over the last 1,5,and 15 minutes,i.e.processes who have everything they need to run but cannot because the CPU is busy doing something else. Some systems may have other states besides the ones listed here
• Task manager in Windows • ps, top • The load average reported by the "w" command indicate the average number of processes in the "Ready" state over the last 1, 5, and 15 minutes, i.e. processes who have everything they need to run but cannot because the CPU is busy doing something else. • Some systems may have other states besides the ones listed here

Process Control Block For each process there is a Process Control Block,PCB process state Process State-Running,waiting,...; ·Process ID process number CPU registers and Program Counter-These need to be program counter saved and restored when swapping processes in and out of the CPU. CPU-Scheduling information-Such as priority registers information and pointers to scheduling queues. Memory-Management information-E.g.page tables or memory limits segment tables. Accounting information-user and kernel CPU time list of open files consumed,time limits,etc. I/O Status information-Devices allocated,open file tables,etc
- Process Control Block • For each process there is a Process Control Block, PCB • Process State - Running, waiting, …; • Process ID • CPU registers and Program Counter - These need to be saved and restored when swapping processes in and out of the CPU. • CPU-Scheduling information - Such as priority information and pointers to scheduling queues. • Memory-Management information - E.g. page tables or segment tables. • Accounting information - user and kernel CPU time consumed, time limits, etc. • I/O Status information - Devices allocated, open file tables, etc
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 西安电子科技大学:《操作系统》课程教学资源(PPT课件)Operating-System Structure.pptx
- 西安电子科技大学:《操作系统》课程教学资源(PPT课件)Introduction(主讲:苏锐丹).pptx
- 《C++ 语言程序设计》课程教学资源(应用阅读)ASCII 码——常用ASCII码.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)ASCII码(256完整版)The ASCII Character Set.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)C++ RC by Mississippi State U.(2009).pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)C++ Reference Card(C++ RC by Greg Book,2002).pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十六讲 标准模板库(Standard Template Library,STL).pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十五讲 文件流与输出输入重载.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十四讲 多态.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十三讲 继承与派生.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十二讲 运算符重载与自动类型转换.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)C++ vector使用方法.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十一讲 类与对象(III)面向对象提高.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第十讲 类与对象(II)面向对象进阶.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第九讲 类与对象(I)面向对象基础.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第八讲 排序算法.pdf
- 华东师范大学:《C++ 语言程序设计》课程教学资源(课件讲稿)第七讲 输入输出与(C 语言)文件操作.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)Pointers and Memory.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)内存分配——栈和堆.pdf
- 《C++ 语言程序设计》课程教学资源(应用阅读)Fast and stable matrix multiplication.pdf
- 《移动互联网技术》课程教学资源(培训教材)Cisco Press - Building the Mobile Internet(Mark Grayson, Kevin Shatzkamer, Klaas Wierenga).pdf
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)01 课程介绍(主讲:苏锐丹).ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)02 移动互联网概述.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)03 移动互联网技术(Android安全).ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)03 Android应用安全 Android application security.pptx
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)03 传输层移动性.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)03 应用层移动性.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)03 相关支撑技术.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)04 数据链路层移动性技术.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)05 网络层Mobility.ppt
- 西安电子科技大学:《移动互联网技术》课程教学资源(PPT课件)06 移动互联网IPv6.ppt
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(教案讲义,打印版)实验教学大纲.pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(教案讲义,打印版)理论教学大纲.pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第1章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第2章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第3章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第4章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第5章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第8章(作业,打印版).pdf
- 兰州交通大学:《单片机原理与接口技术》课程教学资源(课后作业)第10章(作业,打印版).pdf