中国高校课件下载中心 》 教学资源 》 大学文库

上海交通大学:《现代操作系统》课程教学资源(PPT课件讲稿)Chapter 02 进程与线程 Process and Thread

文档信息
资源类别:文库
文档格式:PPS
文档页数:213
文件大小:1.18MB
团购合买:点击进入团购
内容简介
 Processes  Threads  Inter-process communication  Classical IPC problems  Scheduling
刷新页面文档预览

斗★ ★长 Chapter 2: Process/Thread ★★ Instructor. HengmingZou, Ph. D n Pursuit of absolute Simplicity求于至简,归于永恒

1 Chapter 2: Process/Thread Instructor: Hengming Zou, Ph.D. In Pursuit of Absolute Simplicity 求于至简,归于永恒

★ Content ¥ 斗 ★★ ≈ Processes s Threads o Inter-process communication o Classical IPC problems o Scheduling

2 Content  Processes  Threads  Inter-process communication  Classical IPC problems  Scheduling

★ Definition of a process ¥ 斗 ★★ s Informal A prog amin execution A runningpiece of codealongwith all the things the progam can read/write ≈Foma One or more threadsin their own addressspace o Note that process!= program

3 Definition of A Process  Informal – A program in execution – A running piece of code along with all the things the program can read/write  Formal – One or more threads in their own address space  Note that process != program

★ The need for process ¥ 斗 ★★ o What is the priniple motivation for inventing process Tosupportmultiprogamming

4 The Need for Process  What is the principle motivation for inventing process? – To support multiprogramming

★ The Process model ¥ 斗 ★★ o Conceptual viewing of the processes o Concurrency Multiple processesseemto run conaumently But in reality only one activeatany instant s Progress Every processmakes progress

5 The Process Model  Conceptual viewing of the processes  Concurrency – Multiple processes seem to run concurrently – But in reality only one active at any instant  Progress – Every process makes progress

★ Multiprogrammingof 4 programs ¥ ★ One program counter Four program counters AProcess switch B A B D B D Time Programs in memory Conceptual view Time line view

6 Programs in memory Conceptual view Time line view Multiprogramming of 4 programs

★ Process Creation ¥ 斗 ★★ Principal events that cause process creation 1. System initialization 2. Execution of a process creation system 3. User request to create a new process

7 Process Creation Principal events that cause process creation 1. System initialization 2. Execution of a process creation system 3. User request to create a new process

★ Process Temination ¥ 斗 ★★ Conditionswhich teminate processes 1. Nomal exit(voluntary) 2. Error exit(voluntary) 3. Fatal error(involuntary) 4. Killed by another process (involuntary)

8 Process Termination Conditions which terminate processes 1. Normal exit (voluntary) 2. Error exit (voluntary) 3. Fatal error (involuntary) 4. Killed by another process (involuntary)

★ Process hierarchies ¥ 斗 ★★ o Parent creates a child process o Child processes can create its own process o Processes creation foms a hierarchy UNdX callsthis a"processgroup Windowshasno concept of such hierarchy, i.e. all processesare createdequal

9 Process Hierarchies  Parent creates a child process  Child processes can create its own process  Processes creation forms a hierarchy – UNIX calls this a "process group" – Windows has no concept of such hierarchy, i.e. all processes are created equal

★ Process states ¥ 斗 ★★ o Possible process states running blocked read Running Process blocks Scheduler picks for input another process Scheduler picks this process Blocked Ready Input becomes available

10 Process States Running Blocked Ready  Possible process states – running, blocked, ready Process blocks for input Scheduler picks another process Input becomes available Scheduler picks this process

刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档