CS 110, Architecture and Operating Systems
Threads Project
Due May 3, 2002, 9 P.M.
Version 1.0
Introduction
This is a modification of
the solution to
the Basic Barbershop project
in that you are to now use Solaris or POSIX threads instead of
processes.
You also must synchronize using
mutexes and condition variables (no semaphores are allowed).
There are no changes to how the barbershop operates
from the description of the Basic Barbershop project.
Thus, this is really just a straight conversion.
What to Submit:
- Submit the code using
cs110submit
or
cs110submitall
- Include a README file that
describes your implementation,
including your use of threads, mutexes,
and condition variables.
Be sure to address the following issues:
- How you used thread features to handle any semaphore activity,
e.g., counting semaphores.
- Comparison of the ease of programming the Basic
Barbershop project and the Threads Barber Shop Project.
- How you used system resources, and how your program
performs (look at the following tools):
-
truss
-
vmstat
-
iostat
-
time
-
prof
, gprof
Your README needs to be complete and detailed!!!
- A script of a test run using the input files
input2 and
input3.
NOTES:
- You must specify
-lthread
or
-lpthread
as the last thing on your link
line (the ``g++ -o foo ...
'' or your program won't
work right. If you forget to do this step, you won't get any
compilation errors, but you will get mysterious failures at run
time.
- See page 107 of the first reference below for a discussion of
libraries and header files.
References:
- In the terminal room there are copies of a Solaris threads manual.
(look at chapters 2 and 3, it is all there)
- Posix
Threads Programming
- The usual obtuse Solaris man pages for
threads
,
mutexes
, and condition variables
- Chapter 3, UNIX Network Programming, W. Richard
Stevens. On reserve in the library.
- If you find other good references, please let me know.
Last modified April 23, 2002 by geoff@cs.hmc.edu