Operating System
  • Introduction
  • Chapter 1 Introduction
  • Chapter 2 Operating System Structures
  • Chapter 3 Processes
    • 3.1 Process Concept
    • 3.2 Process Scheduling
    • 3.3 Operation on Processes
    • 3.4 Interprocess Communication
  • Chapter 4 Threads
    • Summary: slides
    • 4.1 Overview
    • 4.2 Multithreading Models
    • 4.3 Thread Libraries
    • 4.4 Threading Issues
  • Chapter 6 Process Synchronization
    • 6.1 Background
    • 6.2 Critical-section problem
    • 6.3 Peterson's Solution
    • 6.4 Synchronization Hardware
    • 6.5 Semaphores
  • Summary ch1
  • Summary ch2
  • Summary ch3
  • Summary ch4
  • Summary ch5
  • Summary ch7
  • Summary ch6
  • Summary ch8
Powered by GitBook
On this page

Was this helpful?

Summary ch5

PreviousSummary ch4NextSummary ch7

Last updated 5 years ago

Was this helpful?

  1. Race Condition:A situation where several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place.

  2. Critical Section:

  3. Solution to Critical Section Problem:

    (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 – When no process is in a critical section, any process that requests entry to its critical section must be permitted to enter without delay.

    (3)Bounded Waiting - A bound must exist 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

  4. Mutual Exclusion: Hardware Support

    (1)Interrupt Disabling:

    A process runs until it invokes an operating system service or until it is interrupted;

    Disabling interrupts guarantees mutual exclusion

    (2)Disadvantages:

    Processor is limited in its ability to interleave programs;

    Will not work in multiprocessor architecture.

  5. Mutual Exclusion Machine-Instruction:

    Advantages:

    (1)Applicable to any number of processes on a single processor

    (2)Processes on multiple processors(as long as processors share main memory)

    (3)simple and therefore easy to verify

    (4)It can be used to support multiple critical sections

    Disadvantages:

    (1)Busy-waiting consumes processor time

    (2)Starvation is possible when a process leaves a critical section and more than one process is waiting

  6. Semaphore is a variable that has an integer value

    (1)May be initialized to a nonnegative number

    (2)Wait operation decrements the semaphore value

    (3)Signal operation increments semaphore value

  7. Mutual Exclusion Using Semaphores: