process synchronization - Operating System Vishnu...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Operating System Vishnu Sharma(MCA) www.examengine.info 1 | P a g e 1. Critical Section Problem Consider a system consisting of n processes {Po,P1, ..., P,-1). Each process has a segment of code, called a critical section, in which the process may be changing common variables, updating a table, writing a file, and so on. The important feature of the system is that, when one process is executing in its critical section, no other process is to be allowed to execute in its critical section. Thus, the execution of critical sections by the processes is mutually exclusive in time. The critical-section problem is to design a protocol that the processes can use to cooperate. Each process must request permission to enter its critical section. The section of code implementing this request is the entry section. The critical section may be followed by an exit section. The remaining code is the, remainder section. Do{ Entry section Critical section Exit section Remainder section }while(1); Fig 1.1 General structure of a typical process P i A solution to the critical-section problem must satisfy the following three requirements: 1. Mutual Exclusion : If process Pi is executing in its critical section, then no other processes can be executing in their critical sections. 2. Progress : If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing in their Operating System Vishnu Sharma(MCA) www.examengine.info 2 | P a g e remainder section can participate in the decision on which will enter its critical section next, and this selection cannot be postponed indefinitely. 3. Bounded Waiting : There exists a bound on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted. We assume that each process is executing at a nonzero speed. However, we can make no assumption concerning the relative speed of the n processes. In Sections 1.1.1 and 1.1.2 , we work up to solutions to the critical-section problem that satisfy these three requirements. The solutions do not rely on any assumptions concerning the hardware instructions or the number of processors that the hardware supports. We do, however, assume that the basic machine language instructions (the primitive instructions such as load, store, and test) are executed atomically. That is, if two such instructions are executed concurrently, the result is equivalent to their sequential execution in some unknown order. Thus, if n load and a store are executed concurrently, the load will get either the old value or the new value, but not some combination of the two. When presenting an algorithm, we define only the variables used for synchronization Purposes, and describe only a typical process Pi whose general structure is shown in Figure 1.1 . The entry section and exit section are enclosed in boxes to highlight these important ....
View Full Document

Page1 / 19

process synchronization - Operating System Vishnu...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online