当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

上海交通大学:《操作系统 Operating System》课程教学资源(课件讲稿)OS-process_Lec6

资源类别:文库,文档格式:PDF,文档页数:33,文件大小:589.48KB,团购合买
点击下载完整版文档(PDF)

OPERATING SYSTEMS 1 龚玲 lgong@sjtu.edu.cn

OPERATING SYSTEMS 龚玲 lgong@sjtu.edu.cn 1

CHAPTER 3:PROCESSES Operating System Concepts with Java-7th Edition,Nov 15,2006 Silberschatz,Galvin and Gagne 2007

Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 CHAPTER 3: PROCESSES

CHAPTER 3:PROCESSES o Process Concept o Process Scheduling o Operations on Processes o Cooperating Processes o Inter process Communication o Communication in Client-Server Systems

CHAPTER 3: PROCESSES  Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Inter process Communication  Communication in Client-Server Systems

REVIEW o Process states o PCB o Process scheduling queues o Schedulers o Operations on processes o http://wenku.baidu.com/course/study/77f1dcccda38376ba flfae94#665ea0c7aa00b52acfc7ca94

REVIEW  Process states  PCB  Process scheduling queues  Schedulers  Operations on processes  http://wenku.baidu.com/course/study/77f1dcccda38376ba f1fae94#665ea0c7aa00b52acfc7ca94

GOALS FOR TODAY o Operations on processes

GOALS FOR TODAY  Operations on processes

PROCESS CREATION o Parent process create children processes,which, in turn create other processes,forming a tree of processes o Resource sharing Parent and children share all resources Children share subset of parent's resources Parent and child share no resources o Execution Parent and children execute concurrently Parent waits until children terminate

PROCESS CREATION  Parent process create children processes, which, in turn create other processes, forming a tree of processes  Resource sharing  Parent and children share all resources  Children share subset of parent’s resources  Parent and child share no resources  Execution  Parent and children execute concurrently  Parent waits until children terminate

A TREE OF PROCESSES ON A TYPICAL SOLARIS Sched pid 0 init pageout fsflush pid =1 pid =2 pid =3 inetd dtlogin pid =140 pid 251 telnetdaemon Xsession pid=7776 pid 294 Csh sdt shel pid=7778 pid =340 Csh pid=1400 Netscape emacs pid=7785 pid=8105 Is cat pid=2123 pid=2536

A TREE OF PROCESSES ON A TYPICAL SOLARIS

PROCESS CREATION (CONT.) o Address space Child duplicate of parent Child has a program loaded into it o UNIX examples fork system call creates new process exec system call used after a fork to replace the process'memory space with a new program

PROCESS CREATION (CONT.)  Address space  Child duplicate of parent  Child has a program loaded into it  UNIX examples  fork system call creates new process  exec system call used after a fork to replace the process’ memory space with a new program

PROCESS CREATION parent resumes wait fork() child exec() exit()

PROCESS CREATION

PROCESS CREATION IN POSIX #include #include #include int main() pid_t pid; /fork a child process * pid fork(); if (pid 0){/*error occurred * fprintf(stderr,"Fork Failed"); exit(-1); else if (pid ==0){/*child process * execlp("/bin/1s","1s",NULL); else{/*parent process * /parent will vait for the child to complete * wait(NULL); printf("Child Complete"); exit(0);

PROCESS CREATION IN POSIX

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共33页,可试读12页,点击继续阅读 ↓↓
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有