Operating Systems - Chapter 5

  1. Three central themes of OS design
    • Multiprogramming
    • Multiprocessing
    • Distributed processing
  2. Three contexts in which concurrency arises
    • Multiple applications
    • Structured applications
    • Operating system structure
  3. Atomic operation
    • A function, or sequence of instructions that is indivisible
    • Must execute entirely, or not at all
  4. Critical section
    • Section of code requiring access to shared resources
    • Must not be executed while another process is inside it
  5. Deadlock
    When two or more processes are unable to complete, because they are waiting for the other to finish
  6. Livelock
    • When two or more processes continually change states in response to the other
    • No useful work is done
  7. Mutual exclusion
    Requirement that when a process is in a critical section, no other processes are in the critical section
  8. Race condition
    • Multiple threads reading/writing to a shared resource
    • Final outcome depends on the relative timing of execution (of the processes)
  9. Starvation
    When a runnable (ready) process is continually overlooked by the scheduler
  10. Software approaches to mutual exclusion (algorithm names)
    • Dekker's algorithm
    • Petersons's algorithm
  11. Three difficulties with concurrency/shared resources
    • Race conditions can arise
    • Hard to prevent deadlock
    • Programming errors are hard to locate
  12. Four OS design and management issues caused by concurrency
    • Difficulties tracking progress
    • Difficulties handling allocation and deallocation of resources
    • Difficulties dealing with data and physical resource protection
    • Race conditions occur if process function and result must be independent of relative speeds
  13. Resources that might be accessed by multiple processes
    • Processor time
    • Memory
    • Files
    • I/O Devices
  14. Three types of process interaction
    • Processes are unaware of eachother
    • Processes are indirectly aware of eachother (via a shared resource)
    • Processes are directly aware of eachother
  15. How processes that are unaware of eachother interact
    Competition for shared resources
  16. How processes that are indirectly aware of eachother interact
    Cooperation, via shared resources
  17. How processes that are directly aware of eachother interact
    Direct communication
  18. Influence processes that are unaware of eachother can have on eachother
    • Results of one process independent of the action of the others
    • Timing of the process may be affected
  19. Influence processes that are aware of eachother (directly or indirectly) can have on eachother
    • Results of one process may depend on informaiton obtained from the other(s)
    • Timing of the process may be affected
  20. Control problems associated with processes that are unaware of eachother
    • Mutual exclusion
    • Deadlock (renewable resource)
    • Starvation
  21. Control problems associated with processes are indirectly aware of eachother
    • Mutual exclusion
    • Deadlock (renewable resource)
    • Starvation
  22. Control problems associated with processes that are directly aware of eachother
    • Deadlock (consumable resource)
    • Starvation
  23. Three types of process interactions
    • Competition
    • Cooperation
    • Direct communication
  24. Six requirements for mutual exclusion
    • Mutual exclusion must be enforced
    • Halts in non-critical sections mustn't affect other processes
    • No possibility of deadlock or starvation
    • If a critical section is free, a process trying to use it should be allowed to without delay
    • No assumptions made about process speeds or # of processors
    • Finite time limit for processes to be in critical sections
  25. Hardware approaches to mutual exclusion
    • Interrupt disabling
    • Special machine instructions
  26. Three levelsĀ mutual exclusion can be implemented
    • Program level
    • OS level
    • Hardware level
  27. Two machine instructions for supporting mutual exclusion
    • Compare and swap instruction
    • Exchange instruction
  28. Pros of machine instructions for supporting mutual exclusion
    • Applicable to any number of processes
    • Simple and easy to verify
    • Can support multiple critical sections
  29. Cons of machine instructions for supporting mutual exclusion
    • Uses busy (or spin) waiting
    • Starvation can occur
    • Deadlock can occur
  30. Semaphore
    Integer used for signaling purposes
  31. Mutex
    A sempahore, but must be unlocked by the process that locked it
  32. Binary semaphore
    A sempahore that can only haves the values 0 or 1
  33. Condition variable
    Data type that is used to block a process or thread until a particular condition is true
  34. Operations that are defined for a semaphore
    • Initialization
    • semWait
    • semSignal
Author
Ant
ID
359607
Card Set
Operating Systems - Chapter 5
Description
Updated