Apr 12, 2020 | MIT 6.828
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();...
Apr 11, 2020 | MIT 6.828
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...
Apr 7, 2020 | MIT 6.828
Getting familiar with Pthreads. Download ph.c: #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <assert.h> #include <pthread.h> #include <sys/time.h> #define SOL #define NBUCKET 5 #define NKEYS 100000 struct entry...
Apr 6, 2020 | MIT 6.828
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...
Apr 3, 2020 | MIT 6.828
user@computer$ alarmtestalarmtest starting…………………………………………alarm!………………………………………………alarm!……………………………………………………alarm!……………………………………………………………………………alarm!………………………………………………alarm!………………………………………………………………alarm!…………………………………………alarm!…………………………………………………………… alarm! Well, I find...
Mar 31, 2020 | MIT 6.828
K> showmappings 0xef7bc000Virtual Address Physical Address Flags0xef7bc000 0x003fd000 ——————U—PK> chpgperm clear 0xef7bc000[0xef7bc000 – 0xef7bd000): Supervisor | Read-onlyK> showmappings 0xef7bc000Virtual Address Physical...