Lecture Operating systems: A concept-based approach (2/e): Chapter 3 - Dhananjay M. Dhamdhere

Chapter 3 - Processes and threads. This chapter begins by discussing how an application creates processes through system calls and how the presence of many processes achieves concurrency and parallelism within the application. It then describes how the operating system manages a process - how it uses the notion of process state to keep track of what a process is doing and how it reflects the effect of an event on states of affected processes. The chapter also introduces the notion of threads, describes their benefits, and illustrates their features. | PROPRIETARY MATERIAL. © 2007 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission. What is a process? A process is an execution of a program (Note the emphasis on ‘an’) A programmer uses the notion of a process to achieve concurrency within an application program Such a program can complete earlier than a sequential program An OS uses the notion of a process to control execution of a program This way, the OS can handle execution of sequential and concurrent programs in a uniform manner Example of processes in an application Consider a satellite data logging application Specification The satellite sends samples to | PROPRIETARY MATERIAL. © 2007 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission. What is a process? A process is an execution of a program (Note the emphasis on ‘an’) A programmer uses the notion of a process to achieve concurrency within an application program Such a program can complete earlier than a sequential program An OS uses the notion of a process to control execution of a program This way, the OS can handle execution of sequential and concurrent programs in a uniform manner Example of processes in an application Consider a satellite data logging application Specification The satellite sends samples to earth periodically The computer receives them in a special register The application periodically copies a sample into a file on disk This is a real time application — a sample has to be copied before the next sample arrives Four processes are created for the application (see next slide) The OS creates the primary process This process creates three processes as its child processes by making system calls Tasks in a real time application for data logging Process 1 copies the sample into a buffer in memory Process 2 copies the sample from the buffer into the file Process 3 performs housekeeping and statistical analysis Process tree for the real time application The OS creates the primary process when the application is initiated; it is called ‘main’ in this diagram The primary process creates the other three processes through system calls; they are its child processes Benefits of child processes Use of child processes has three benefits Computation speed-up OS may interleave operation of

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.