CSE2302 CMG-2003-09

Tutorial Sheet 3

Process Management, Interprocess Communications and Synchronization

1. Objectives and Outcomes

1.1 Objectives

  1. To review material covered in the lectures (chapters 4 and 7);
  2. To confirm understanding of concepts such Process, Process Control Block Process States, Scheduler, Process Queues, Context Switch, Process Creation, Process Termination, Interprocess Communication, Critical-Section, Atomic Transactions, Semaphores and Monitors;
  3. To answer questions arising from lectures during the next few weeks;

1.2 Outcomes

  1. You should be able to describe the purpose of various Process Management and Interprocess Communications concepts;
  2. You should be able to explain in detail the sequence of tasks performed by the Operating-System components during process management and information transfers between processes; and
  3. You should be able to explain the need for these components to support Modern Operating Systems.

2. The Basics

  1. Give the definition of a PROCESS.
  2. Draw the state diagram for processes and label the states and the transitions between the scheduling states.
  3. Describe the differences between short-term, medium-term and long-term scheduling.
  4. Describe the actions which need to be taken by the OS to complete a task-switch(process-switch).
  5. What is the principal advantage of multiprogramming, in a systems with virtual memory? Is CPU utilisation the only advantage?
  6. What is the major advantage of multiprogramming in systems without virtual memory.
  7. Describe some possible causes of process termination.
  8. Describe the main need for Interprocess Communications with respect to shared resources.
  9. Define the term critical-section-problem and describe the why this problem needs to be solved. Start with mutual-exclusion.
  10. Define the term deadlock.
  11. Name and describe the four necessary conditions which must be true for deadlock to occur.
  12. How can the above conditions be used to avoid seadlock?
  13. Briefly review the use of resource allocation graphs to represent deadlock. You need to represent process nodes, resource nodes, resource allocations and resource requests.

3. Process Management

  1. Define pre-emtive scheduling, and compare it with non-pre-emptive scheduling.
  2. For each of the following transitions between process states in a preemptive scheduling environment, indicate whether the transition is possible.If it is possible, give an example of a possible cause for the transition:
    1. run -> ready
    2. run -> blocked
    3. run -> swapped-blocked(define this)
    4. blocked -> run
    5. run -> run
    6. ready -> terminated
  3. What effect do interrupts have on the scheduler?
  4. Given that process queues can be prioritized, what factors can be used to determine a processes priority?
  5. Give a definition for round-robin scheduling
  6. Give a definition for First-come-first-serve scheduling.

4. Synchronisation for Interprocess Comms

  1. Define the term Race-Condition.
  2. Define the term Atomic Transaction(Operation), and describe why such operations tend to be implemented on hardware rather than software.
  3. Is synchronisation of processes absolutely necessary? If not why not?
  4. Give a description of a counting semaphore. How is a counting semaphore used in the solution to the Producer-Consumer Problem.
  5. Describe the critical section code in the producer consumer problem code given in the text book
  6. Describe and define Deadlock and Starvation.
  7. Monitors are usually implemented as a programming language feature. Monitors are a programming construct which ensure that only one process can be active in the monitor code at a time. Can monitors be used to replace semaphores?
  8. After the tute find out about monitors, as implemented in JAVA from the SUN MicroSystems web page.

5. Any Other Issues