انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية تكنولوجيا المعلومات
القسم قسم البرامجيات
المرحلة 3
أستاذ المادة مهدي نصيف جاسم الشمري
1/18/2012 7:47:36 AM
The fundamental task of any modern operating system is process management. The operating system must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes, and enable synchronization among processes.To meet these requirements, the operating system must maintain a data structure for each process that describes the state and resource ownership of that process and that enables the operating system to exert process control. On a multiprogramming uniprocessor, the execution of multiple processes can be interleaved in time. On a multiprocessor, not only may process execution be interleaved, but also multiple processes can execute simultaneously. Both interleaved and simultaneous execution are types of concurrency and lead to a host of difficult problems, both for the application programmer and the operating system. In many contemporary operating systems, the difficulties of process management are compounded by the introduction of the concept of thread. In a multithreaded system, the process retains the attributes of resource ownership, while the attribute of multiple, concurrent execution streams is a property of threads running within a process.
Background
Before defining the term process, it is useful to summarize some of the concepts introduced in Chapters 1 and 2: 1. A computer platform consists of a collection of hardware resources, such as the processor, main memory, I/O modules, timers, disk drives, and so on. 2. Computer applications are developed to perform some task.Typically, they accept input from the outside world, perform some processing, and generate output. 3. It is inefficient for applications to be written directly for a given hardware platform. The principal reasons for this are as follows:
a. Numerous applications can be developed for the same platform.Thus, it makes sense to develop common routines for accessing the computer’s resources. b. The processor itself provides only limited support for multiprogramming. Software is needed to manage the sharing of the processor and other resources by multiple applications at the same time. c. When multiple applications are active at the same time, it is necessary to protect the data, I/O use, and other resource use of each application from the others. 4. The OS was developed to provide a convenient, feature-rich, secure, and consistent interface for applications to use.The OS is a layer of software between the applications and the computer hardware (Figure 2.1) that supports applications and utilities. 5. We can think of the OS as providing a uniform, abstract representation of resources that can be requested and accessed by applications. Resources include main memory, network interfaces, file systems, and so on. Once the OS has created these resource abstractions for applications to use, it must also manage their use. For example, an OS may permit resource sharing and resource protection. Now that we have the concepts of applications, system software, and resources, we are in a position to discuss how the OS can, in an orderly fashion, manage the execution of applications so that • Resources are made available to multiple applications. • The physical processor is switched among multiple applications so all will appear to be progressing. • The processor and I/O devices can be used efficiently. The approach taken by all modern operating systems is to rely on a model in which the execution of an application corresponds to the existence of one or more processes.
Processes and Process Control Blocks Recall from Chapter 2 that we suggested several definitions of the term process, including • A program in execution • An instance of a program running on a computer • The entity that can be assigned to and executed on a processor • A unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system resources We can also think of a process as an entity that consists of a number of elements. Two essential elements of a process are program code (which may be shared with other processes that are executing the same program) and a set of data associated with that code. Let us suppose that the processor begins to execute this program
code, and we refer to this executing entity as a process. At any given point in time, while the program is executing, this process can be uniquely characterized by a number of elements, including the following: • Identifier: A unique identifier associated with this process, to distinguish it from all other processes. • State: If the process is currently executing, it is in the running state. • Priority: Priority level relative to other processes. • Program counter: The address of the next instruction in the program to be executed. • Memory pointers: Includes pointers to the program code and data associated with this process, plus any memory blocks shared with other processes. • Context data: These are data that are present in registers in the processor while the process is executing. • I/O status information: Includes outstanding I/O requests, I/O devices (e.g., tape drives) assigned to this process, a list of files in use by the process, and so on. • Accounting information: May include the amount of processor time and clock time used, time limits, account numbers, and so on. The information in the preceding list is stored in a data structure, typically called a process control block (Figure 3.1), that is created and managed by the OS. The significant point about the process control block is that it contains sufficient
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|