As always, download barrier.c and read it. main() creates argv[1] number of Pthreads. Each thread does: static void * thread(void *xa) { long n = (long) xa; long delay; int i; for (i = 0; i < 20000; i++) { int t = bstate.round; assert (i == t); barrier();...
If a concurrent thread causes the condition to be true, that thread must either hold the lock on the condition before the sleeping thread acquired it, or after the sleeping thread released it in sleep. If before, the sleeping thread must have seen the new condition...
divzero: OK (1.0s)softint: OK (0.7s)badsegment: OK (1.0s)Part A score: 30/30 faultread: OK (0.9s)faultreadkernel: OK (1.0s)faultwrite: OK (1.4s)faultwritekernel: OK (0.5s)breakpoint: OK (3.4s)testbss: OK (4.0s)hello: OK (1.5s)buggyhello: OK (4.5s)buggyhello2: OK...