《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
340 B

#include <ulib.h>
#include <stdio.h>
int
main(void) {
int i;
cprintf("Hello, I am process %d.\n", getpid());
for (i = 0; i < 5; i ++) {
yield();
cprintf("Back in process %d, iteration %d.\n", getpid(), i);
}
cprintf("All done in process %d.\n", getpid());
cprintf("yield pass.\n");
return 0;
}