mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 02:03:29 +01:00
Updated test0 with a forktest. Fixed timeslices. Updated kmem usage calculations.
- test0 now forks 16 tasks that each modify a global variable. - scheduler now gives 1/10th of a second per task. It also does not increase timeslice of a task that has scheduled. - When a memory is granted to the kernel, the distribution of this memory to memcaches was calculated in a complicated way. This is now simplified.
This commit is contained in:
@@ -38,13 +38,19 @@ void main(void)
|
||||
printf("Error forking...\n");
|
||||
|
||||
if (pid == 0) {
|
||||
printf("File IO test 1, done by child:\n");
|
||||
printf("Child: file IO test 1.\n");
|
||||
if (fileio() == 0)
|
||||
printf("-- PASSED --\n");
|
||||
else
|
||||
printf("-- FAILED --\n");
|
||||
|
||||
printf("Child: forktest.\n");
|
||||
if (forktest() == 0)
|
||||
printf("-- PASSED -- \n");
|
||||
else
|
||||
printf("-- FAILED -- \n");
|
||||
} else {
|
||||
printf("File IO test 2, done by parent, with child pid %d:\n", pid);
|
||||
printf("Parent: file IO test 2. child pid %d:\n", pid);
|
||||
if (fileio2() == 0)
|
||||
printf("-- PASSED --\n");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user