CSC 213:  Operation Systems and Parallel Algorithms

Laboratory Exercise on Signals and Timers

Goals: This lab exercsie provides experience with system timers and signals.

Credit: The lab is based on Lab Exercise 6.1 in Operating Systems, Third Edition by Gary Nutt, Addison-Wesley/Pearson Education, 2004.

Basic Problem: Determine the time required to perform a quicksort of 10000, 20000, 40000, 80000, and 160000 items in both a single-process context and in a multiple-process context.

Some Problem Specifics:

Guidelines for each program:

  1. Each collection of timings should use three timers:
  2. The quicksort should be performed on an array of random data.

Required Programs:

  1. As a base line, a first program should set the three timers indicated above, perform a quicksort, and retrieve processing times in a single-process environment. This program should not include any fork or signal calls. Also, timing should not include the time required to initialize the array.

    This first program may perform the timing, quicksort, and printout for a single array size, with the program rerun for each of the array sizes given above. Alternatively, the program may call the timing, quicksort, and printout steps within a loop to handle all array sizes with a single execution of the program.

  2. Modify the program ~walker/213/c-examples/signal-1.c, so that a parent process the amount of time required for each quicksort that is performed in a child process. As with the base line program, timing should not include the time required to initialize arrays.

  3. Extend the second program to obtain a program that spawns two processes, each of which sets a timer, performs a quicksort, and prints its own processing times. In this third program, each child will do its own processing and timing. The parent process only monitors the other activities. If you wish, you may use Nutt's program outline from lab exercise 6.1 as a base.

Resources:


Work to be turned in:


This document is available on the World Wide Web as

     http://www.cs.grinnell.edu/~walker/courses/213.fa04/lab-signals.shtml

created September 20, 2004
last revised September 21, 2004
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at (walker@cs.grinnell.edu)