Fall 2000, MCS4663: Operating Systems, Section 02

Chan-Jin Chung

Department of Math. and Computer Science

Lawrence Tech University


Syllabus

(The following pages need password to enter. If you need help, email at chung@ltu.edu)

Java Source Codes





Announcement

The instructor usually closes his office door. (It is too noisy to open the door because the office is close to the entrance and the copy room.) Please knock the door during scheduled office hour, if the door is closed.

Homework Programming Assignment #1: See class handout

Homework Assignment #1

newproc.c

Homework Programming Assignment 21 and 22: See class handout

Homework Programming Submission Rules

Quiz #1:

Prog HW 3 and 4: Due Thu. 10-19

Class Changes

OS Midterm: Thu. Nov. 9

Prog HW 5 and 6: Due Thu. 11-2

HW #2

Prog HW 5 (Due. Nov. 30, 20 points)

The solution to the readers-writers problem does not prevent waiting writers from starving: If the database is currently being read and there is a waiting writer, subsequent readers will be allowed to read the database before the writer can write. Modify the solution such that it does not starve waiting writers. Implement two versions in Java. One using semaphores and the other using "synchronized" Java keyword.

Prog HW 8 (Due. Dec. 5, 7 points)

As Programming Homework 6, we did multithreaded solution to the bounded-buffer problem that used message passing. The MessageQueue class is not considered thread safe, meaning that race condition is possible when multple threads attempts to concurrently access the queue. Modify the MessageQueue class using Java synchronization such that it is thread safe.

Prog HW 9 (Due. Dec. 12, 10 points)

Create a BinarySemaphore class that implements a binary semaphore.

Prog HW10 (Due. Dec. 19, 10+? points)

The Sleeping-Barber Problem: A barbershop consists of a waiting room with n chairs, and a barber room with one barber chair. If there are no customers to be served, the barber goes to sleep. If a customer enters the barbershop and all chairs are occupied, then the customer leaves the shop. If the barber is busy, but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the customer wakes up the barber. Write a program to coordinate the barber and the customers using Java synchronization.