#include /* test1.c * There are two processes Main process and Proc A with rates 20, 30 * respectively. After 5 secs from the system start,Proc A sleeps for 30 seconds * During that time, Main monopolises the CPU. When Proc A wakes up from sleep, * its Pi value should get updated and we can expect it to monopolise the CPU * for some time, till its Pi value becomes on par with that of Main. Calculate * how much time Proc A takes after wakeup to catch up with Main. Report this * value along with the results of test5.c. Compare your results with results * calculated theoretically. */ int prch(), prA, prB, prC; unsigned long ctr1000; main() { int i, j = 0; kprintf("\n\nTEST1:\n"); resume(prA = create(prch,2000,30, PROPORTIONALSHARE, "proc A",1,'A')); while (1) { /* printing to check status */ kprintf(":%c %d %d:", 'D', j, ctr1000); for (i=0; i< 10000; i++); j++; } } prch(c) char c; { int i,j=0; while(1) { /* printing to check status */ kprintf(":%c %d %d:", c, j, ctr1000); if( ctr1000 >= 5000 && ctr1000 <= 6000 ) sleep(30); /* sleep after 5 secs for 30 secs */ for (i=0; i< 10000; i++); j++; } }