《操作系统》的实验代码。
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

10 years ago
  1. #include <ulib.h>
  2. #include <stdio.h>
  3. int
  4. main(void) {
  5. int i;
  6. cprintf("Hello, I am process %d.\n", getpid());
  7. for (i = 0; i < 5; i ++) {
  8. yield();
  9. cprintf("Back in process %d, iteration %d.\n", getpid(), i);
  10. }
  11. cprintf("All done in process %d.\n", getpid());
  12. cprintf("yield pass.\n");
  13. return 0;
  14. }