CS 3733 Operating Systems, Fall 2008 Recitation Session 6
Wednesday, Oectober 8.
In this session you will experiment with compiling and running programs
that use threads under both Linux and Solaris.
- Log on to your Linux Account.
- Create a rec06 directory.
- Put copies of the following programs in your rec06 directory:
- We have discussed these programs in class.
Review them and make sure you understand what they do.
Compile the programs using make.
- In the following parts of the recitation you will be answering questions
about the results of the runs you do. Put the answers in a file called
answers06.txt in your rec06 directory.
Number each answer with the corresponding part of the recitation.
For example, the first answer should be labeled with a 6.
The first line of this file should contain your name.
You will only be graded on having
completed answers to these questions, not on the quality of your answers.
- Run the getsizeschild program by executing:
     make runchild
Which of the values were reported correctly? Explain why each of the
incorrect ones were incorrect.
- How would the answer above change if the parent waited for the child
before using the results?
- Run the getsizesthread program by executing:
     make runthread
Which of the values were reported correctly? Explain why each of the
incorrect ones were incorrect.
- Comment out the four lines in getsizesthread.c that correspond to
the pthread_join. Explain the results when you compile and
run the program again and explain why the results should or should not be
the same as before.
- Remove the comments and compile and run the program again.
Confirm that the results are what is expected.
- Remove the reference to LIBTHREAD in the compile line for
getsizesthread in the makefile.
- Execute
     make clean
     make
If the program compiles, run it again.
Describe the results.
- Put back the reference to LIBTHREAD in the makefile.
Compile again and convince yourself that the program is working correctly.
- Remotely log into one of the Sun machines in the Sun lab and go into the
rec06 directory. (The Sun machines pandora1 and pandor2 are
good ones to use.) Compile the programs by executing:
     make clean
     make
- Run the two programs again and describe the results. Are they the same
on this systems as they were under Linux?
- Redo Part 9 on this system and describe the results.
- Remove the comments and compile and run the program again.
Confirm that the results are what is expected.
- Remove the reference to LIBTHREAD in the compile line for
getsizesthread in the makefile.
- Redo Part 12 on this system and describe the results. Compare the results
with those of Part 12 on the Linux system.
- Check that your file answers06.txt has answers labeled for parts
6, 7, 8, 9, 12, 15, 16 and 19.
- Copy your answers06.txt to somewhere in your web directory
and put a link to it on your cs3733 web page.
- Show the TA your web page and that you have answered all of the questions.