UTSA CS 4953 Special Studies in Computer Science:
Advanced Topics in Concurrency and Communication Fall 2003


Assignment 1, Due Tuesday, September 9, 2003


Part 0:
Look at page 33 of the POSIX Systems Interfaces Standard. Notice that gettimeofday is not listed as being async-signal safe. Read the statement on the bottom of the page and think about what constraints need to be satisfied to be able to safely call gettimeofday from inside a signal handler.

Part 1:
Carefully look at the abstime program from Chapter 9 of USP and determine whether any async-signal unsafe functions are called from inside the signal handler.

Part 2:
Rewrite the abstime program from chapter 9 of USP so that it uses XSI timers instead of TMR timers. Call the new program xabstime. Since XSI timers do not directly support absolute time, you need to get the current time inside the signal handler. Do this in a safe way.

Part 3:
Run your xabstime program and the original abstime program on at least 2 different systems. For example, you can use the Sparc machines in the Sun lab and the Intel machines in the Linux lab. Compare the results and see if you can draw any conclusions.

Handing in the assignment
You do not need a cover sheet. Hand in your source code along with a discussion comparing the results on the two systems. Include your conclusions and output from the runs that supports your conclusions.