CSE2302 CMG-2003-09
Tutorial Sheet 3
Process Management, Interprocess Communications and Synchronization
1. Objectives and Outcomes
1.1 Objectives
- To review material covered in the lectures
(chapters 4 and 7);
- 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;
- To answer questions arising from lectures during the
next few weeks;
1.2 Outcomes
- You should be able to describe the purpose of various
Process Management and Interprocess Communications concepts;
- 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
- You should be able to explain the need for these components
to support Modern Operating Systems.
2. The Basics
- Give the definition of a PROCESS.
- Draw the state diagram for processes and label
the states and the transitions between the scheduling states.
- Describe the differences between short-term, medium-term and
long-term scheduling.
- Describe the actions which need to be taken by the OS to
complete a task-switch(process-switch).
- What is the principal advantage of multiprogramming, in a systems with
virtual memory? Is CPU utilisation the only advantage?
- What is the major advantage of multiprogramming
in systems without virtual memory.
- Describe some possible causes of process termination.
- Describe the main need for Interprocess Communications with respect
to shared resources.
- Define the term critical-section-problem and describe the why this problem
needs to be solved. Start with mutual-exclusion.
- Define the term deadlock.
- Name and describe the four necessary conditions which must be true
for deadlock to occur.
- How can the above conditions be used to avoid seadlock?
- 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
- Define pre-emtive scheduling, and compare it with non-pre-emptive
scheduling.
- 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:
- run -> ready
- run -> blocked
- run -> swapped-blocked(define this)
- blocked -> run
- run -> run
- ready -> terminated
- What effect do interrupts have on the scheduler?
- Given that process queues can be prioritized, what factors
can be used to determine a processes priority?
- Give a definition for round-robin scheduling
- Give a definition for First-come-first-serve scheduling.
4. Synchronisation for Interprocess Comms
- Define the term Race-Condition.
- Define the term Atomic Transaction(Operation), and describe
why such operations
tend to be implemented on hardware rather than software.
- Is synchronisation of processes absolutely necessary?
If not why not?
- Give a description of a counting semaphore. How is a counting
semaphore used in the solution to the Producer-Consumer
Problem.
- Describe the critical section code in the producer
consumer problem code given in the text book
- Describe and define Deadlock and Starvation.
- 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?
- After the tute find out about monitors, as implemented in
JAVA from the SUN MicroSystems web page.
5. Any Other Issues
- Search for Synchronisation hardware on the web!Why is this
hardware part of the CPU
- Are there any other issues you would like to discuss?