SICE Curriculum Portal for Thomas Heffron
Contents

Home
UMKC Curriculum
   FS '96
      CS 101
   SS '01
      CS 201
   FS '01
      CS 191
      CS 281
   WS '02
      CS 291
      EN 304wi
   SS '02
      CS 352
      CS 481
   FS '02
      CS 431
      CS 441
   WS '03
      CS 423
      CS 451
SICE Survival Guide
Personal Experience

contact me @umkc:
tehqnf@umkc.edu

CS431 - Homework #4
 
/*************************************
Name:     Thomas Heffron (tehqnf@umkc.edu)
Section:  CS431 NET
Program:  Program #4 - worker process
Due Date: Oct. 31, 2002
Desc:     This is a simple worker program
          to create looping processes from
          the main program #4.
Inputs:   No inputs.
Outputs:  Indication of end of each work cycle.
*************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    double y;
    double x = 3.0;
    double e = 2.0;
    int i, j = 0;
    pid_t pid;

    pid = getpid();

    while (1) {
        for (i = 0; i < 400000; i++) {
            y = pow(x, e);
        }
        printf("Loop %d of process %d work cycle\n", j++, pid);
        sleep(1);
    }
}