Homework 4 assigned
Project 3 (aka the 4th project) is now posted. Due on the last day of class.
This course covers three aspects of systems:
This aspect of the course reinforces the necessity of structured design and development methodologies.
The student will also learn common abstractions such as threads, address space and files. As well as more interesting notions such as migrating threads or scheduler activations.
They also learn about very useful constructs for managing resources in a concurrent programming environment: synchronization mechanisms and multi-threaded programs.
However cs306 is not necessary to develop a sufficiently deep understanding of the material presented in cs422. However, the first few lectures of cs422 provide suffucient background.
Required:
Other general references:
The relative weighting of the components of the grades is:
There will be weekly homework assignments from the required text and an occasional short graded quiz. The quizes can be announced or unannounced. Therefore, it is essential that you attend class in order to prepare for the quizes and exams. There will be no makeup quizes.
There will be two exams: a mid-term and a final. Each exam will be worth 20% of your grade. Material tested on the final exam will be comprehensive.
There will be 4-6 programming projects. Three of the assignments (called projects below) will involve substantial programming. Students are assumed to be competent in C or C++ and familiar with the UNIX operating system.
The general criteria for the grading of the programs is given below:
Homework and projects may be submitted up to three days late. However, for each day late 5 points will be deducted. After the third day the homework or project will not be accepted.
Occasionally, in special situations, arrangements for a late submission can be made if requested well in advance of the due date.
| Date | Class # | Topic | Text Chapter |
| 1/8 | 1 | Introduction PPT, PS | 1 |
| 1/10 | 2 | 1 & 2 | |
| 1/15 | 3 | The Process Model PPT, PS | 2 |
| 1/17 | 4 | Processes management in UNIX, See lecture notes from 1/15 | 3 |
| 1/22 | 5 | Interprocess Communications PPT, PS | 3 |
| 1/24 | 6 | Review Project and OS Structure | Class Notes |
| 1/29 | 7 | Threads PPT, PS | 4 |
| 1/31 | 8 | Concurrency and Synchronization PPT,PS | 5 |
| 2/5 | 9 | Concurrency and Synchronization: Continued | 5 |
| 2/7 | 10 | Finish Concurrency and Synchronization | 5 |
| 2/12 | 11 | Deadlocks | 6 |
| 2/14 | 12 | Deadlocks PPT,PS | 6 |
| 2/19 | 13 | Scheduling PPT, | 9 |
| 2/21 | 14 | Scheduling | 9 |
| 2/26 | 15 | Review for Midterm | |
| 2/28 | 16 | Midterm Exam. The midterm is in two parts: part one is to be taken in class and part two it to be tturned in no later then start of class Tuesday, 12 March. Part two in MS Word format, PostScript or PDF. | N/A |
| 3/12 | 17 | Real Time Scheduling PPT or PS | 10 |
| 3/14 | 18 | Memory Management PS, PPT | 7 |
| 3/19 | 19 | Finish Memory Management and start Virtual Memory PS, PPT | 8 |
| 3/21 | 20 | Virtual Memory |
8 |
| 3/26 | 21 | Discussion of Project 2, Quiz, File Systems PPT PS | 12 |
| 3/28 | 22 | File Systems |
12 |
| 4/2 | 23 | Midterm returned and reviewed. I/O Systems PS, PPT |
11 |
| 4/4 | 24 | Mass-Storage Structure PS, PPT | 12 |
| 4/9 | 25 | Networking Overview PPT PS | 13 |
|
4/11 | 26 |
Distributed File Systems PPT, PS | 13 and 14 |
| 4/16 | 27 | Distributed Process Management, PPT, PS | 14 and ClassNotes |
| 4/18 | 28 |
Review for Final - Last Class PPT, PS. | Class Notes and Review Questions |
| 4/26 | 29 | Final exam, Friday 4/26, 1:00PM - 3:00PM | N/A |
You must turn in a hard copy of your homework in class the day it is due. Below are listed the homework assignments and due dates.
A solution to the critical section problem for n processes with a lower bound on waiting of n - 1 turns was presented by Eisenberg and McGuire (reference above).
The shared data and process structure are outlined below. turn is initialized to a number between 0 and n-1 (inclusive), that is, 0 <= turn < n. All elements of the flag array, one per process, are initialized to Idle.
Shared State:
enum pstate {Idle, WantIn, InCS}; pstate flag[n]; // All elements initialed to Idle int turn; // Initialized such that 0 <= turn < nProcess i's code:
do { // Acquire lock while(1) { flag[i] = WantIn; j = turn; while (j != i) { if (flag[j] != idle) j = turn; else j = (j + 1) % n; } flag[i] = InCS; j = 0; while ((j < n) && (j == i || flag[j] != InCS)) j++; if ((j >= n) && (turn == i || flag[turn] == Idle)) break; // Acquired lock, Leave while loop } turn = i; -- Critical Section -- // Release Lock j = (turn + 1) % n; while (flag[j] == Idle) j = (j + 1) % n; turn = j; flag[i] = Idle; -- Remainder Section } while (1);
To get started, assume the following relations:
Resources are ordered by their type number starting at 1 and going to m. Define the relation
Ri <= Rj if and only if i <= j.
When a process Pq requests a resource Ri, the resource is allocated if and only if both of the conditions below are true:
a) Resource Ri is not held by another process and
b) Process Pq does not hold any other resource or if all the resources held by Pq are less than Ri (Rj <= Ri, for all resources Rj currently help by Pq).
When requesting a resource, the resource is either allocated or the requesting process goes to sleep and waits until the resource is available.
For an overview of the general project requirements see Project Requirements and Guidelines . For some background information in UNIX programming see Background.