CS 284 Operating Systems
Programming Assignment #6

Due: 2/16/2001 - Class Time

Write a C program that produces enough neatly formatted out to demonstrate that it has correctly performed the following:

  1. signal(SIGALRM,SIG_IGN);
  2. initialize the random number generator
  3. create a dynamic array named delay of 20 longs
  4. create an array of thread_t to hold 20 thread IDs
  5. create 20 threads each running the same function - named whatever you want
  6. after the 20 threads have been created
  7. join each exiting thread reporting for each thread
  8. when all threads have exit-ed


The function that all the threads are executing should

  1. printf the fact that it's alive and how long it has been asked to sleep
  2. usleep(the argument that it was passed)
  3. return the argument that it was passed


Sample Output - Please don't duplicate.  It's being shown to clarify the assignment.  OK?

footnotes:

  1. pthread's join doesn't report back the thread ID so users of pthreads will have to improvise
  2. ps -fL
=================================================================

You will use the 'script' command to capture all necessary information for handin.