CS 3733 Operating Systems, Fall 2007 Recitation Review
- Recitation 1 Using the system
In this recitation you learned how to compile programs on the
Linux system and you write the get_filesize function.
- Recitation 2: Timing and Static Variables
In this recitation you experimented with the consequences of calling
functions that use static variables.
- Recitation 3:
The Process Scheduling Simulator
In this recitation you started using the simulator and got ready for
Assignment 2.
- Recitation 4: The Process Scheduling Simulator continued
In this recitation you modified the simulator input to do
5 experiments.
There were 10 processes with short CPU bursts and 10 with longer ones.
The algorithms used were FCFS, SJF, RR 1, RR 5 and RR 10.
You should have found that in this case SJF had the best average
waiting time and FCFS was next. Increasing the quantum for the RR
produced better average waiting times and if it were allowed to
increase above the largest CPU burst it would be identical to FCFS.
- Recitation 5: Threads
In this recitation you learned how to compile and run threads under
Linux and Solaris.
Some of the things you should have experienced:
- Here you had a parent and child each calculating a
value and adding it to a sum. Since each had its own
sum variable, the value did not represent the sum
of the values calculated. The program is
here.
- Having the parent wait for the child to finish would
not help here.
- When the same is done with two threads, the threads
share the same sum variable so the sum represents the
sum of the two values. The original process joins the
thread before doing its calculation so there is no
interference. The program is
here.
- If the thread is not joined, what happens depends on
how the original process and the thread are scheduled.
You probably found that under Linux the program usually
gave the correct answer.
- Under Linux, if the reference to -lpthread was removed,
the program would not compile.
- When run under Solaris with the join commented out you
probably found that most of the time the original
process printed its results and exited before the
thread had a chance to execute.
- When run under Solaris, the original program ran as
expected.
- When you try to compile under Solaris without the
-lpthread, the compile is successful but the program
fails on the pthread_create.