Xem mẫu

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. Processes:and Threads Dhamdhere: Operating Systems— Copyright © 2008 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 Processes:and Threads Dhamdhere: Operating Systems— Copyright © 2008 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 Processes:and Threads Dhamdhere: Operating Systems— Copyright © 2008 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 Processes:and Threads Dhamdhere: Operating Systems— Copyright © 2008 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 Processes:and Threads Dhamdhere: Operating Systems— Copyright © 2008 ... - tailieumienphi.vn
nguon tai.lieu . vn