10 busywork_thread (void *start_vp)
12 struct timeval *start_t = start_vp;
15 unsigned a[256] = { 0 };
18 gettimeofday (&t, NULL);
19 if (t.tv_sec >= start_t->tv_sec + 3 ||
20 (t.tv_sec == start_t->tv_sec + 2 &&
21 t.tv_usec >= start_t->tv_usec))
24 for (i = 0; i < 256; ++i) {
26 if (i > 0) a[i] += a[i-1];
35 pthread_t thr[NR_THREADS];
37 struct timeval start_t;
39 gettimeofday (&start_t, NULL);
41 for (i = 0; i < NR_THREADS; ++i)
42 pthread_create (&thr[i], NULL, busywork_thread, &start_t);
43 for (i = 0; i < NR_THREADS; ++i)
44 pthread_join (thr[i], NULL);
52 for (i = 0; i < 5; ++i) {