#include #include #include #include /* test5.c * * This program creates a process A with Ri = 30. The main program has a Ri = 20. * We can expect the programs to get the CPU in the ratio of 20:30 (ie) 4:6. To * check this, we track the progress of the programs by the variable 'j'. At any * time during the execution, the value of the variable 'j' in the processes * should be approx in the same ratio of the rates. Report the values of the * 'j' variable at different times of program execution. */ int prch(char c); int prA, prB, prC; int main() { int i, j = 0; kprintf("\n\nTEST5:\n"); prA = create((int *) prch, 2000, 30, "proc A", 1, 'A'); resume(prA); while (1) { kprintf(":%c %d:", 'D', j); for (i = 0; i < 10000; i++) ; j++; } } int prch(char c) { int i, j = 0; while (1) { kprintf(":%c %d:", c, j); for (i = 0; i < 10000; i++) ; j++; } }