- 3
- 0
- 约1.88万字
- 约 87页
- 2017-03-09 发布于上海
- 举报
UNIX Foundations Your EducationUNIX的基础你的教育
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Interrupt handling Synchronization UNIX is re-entrant UNIX is non-preemptive, keeping the kernel states consistent. Relinquish CPU voluntarily. Blocking Operations Blocks the process (make it sleep). Lock: a single bit flag wanted(flag): sleep(): wake(): wake all the waiting processes. upon waking up: check once again to make sure. Algorithm for resource locking Blocking Interrupts Blocking interrupts while accessing critical sections. int x = splbio();/* raise ipl*/ modify disk buffer cache; splx(x); /*restore ipl*/ Critical region:few brief. Blocked interrupts may access the critical region. Different interrupts may have the same ipl Blocking an interrupt may block others. UNIX Process Implementation New Processes Programs fork: creates a new process. returns 0 to the child, PID to the parent exec: begins to execute a new program Using fork exec if ((result = fork()==0){ /* child code*/ … … if (execve(“new program”),…)0) perror(“execve failed!”); } else if (result0) { perror(“fork”);/*fork failed*/ } /*parent continures here*/ Shell creating a process A highly simplified shell The ls Command Steps in executing the command ls typed to the shell Process Creation Almost an exact clone of the parent. Reserve swap space for the child Allocate a new PID and proc structure for the child Initialize proc structure Allocate address translation map (ATM) Allocate u area and copy Update the u area to refer to the new ATM Swap space Add the child to the set of processes sharing the text region of the program Duplicate the parent’s data and stack regions update ATM to refer to these new pages. Acquire references to shared resources in
您可能关注的文档
- This Century Challenges Sensor Networks for Environmental本世纪挑战传感器网络环境.ppt
- Thirteenth Annual Celebrating Leadership in Education 第十三年度庆祝教育领导.ppt
- This is How you play Field Lacrosse staffweb这是你如何玩场曲棍球 staffweb.srk12.ppt
- This Is The Day He Has Made Me Glad PRAISE 这是一天他让我高兴赞美.ppt
- This is the Day #590 sonyanancysims这一天是590 sonyanancysims #.ppt
- THIS IS THE TITLE SLIDE USDA这是标题幻灯片美国农业部.ppt
- This is Where You Type the Slide Title Blinn College这是您键入幻灯片标题宾氏学院.ppt
- This Land is Your Land” Teachers这片土地是你的土地老师.Henrico Webserver.ppt
- Thisted Gymnasium bricksitebricksite齐斯泰兹健身房.ppt
- Thomas Hardy englishcourse托马斯哈代英语.ppt
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)