. - , . - , " , ". , - . - , . - : , - VAX/VMS ([Levy 82]). 286 9.4  - , V UNIX. . , ( fork, exec sbrk ), , . ( 0), - , , . , . - , - ( - ); - . - . , - ; . , "" , , "" , . - , , - . , - . - . -, fork, , . -, , exec - . - , , , - , , "" , . 9.5  1. mfree, - . 2. 9.1.2 , - , . , ? 3. , . ? 4. , ? , ? *5. , , - 287 , . , , . , , , , ? , - ? 6. , 9.10, , 1 . 7. , 9.11. , . - - ? +----------------------------------+ | main() | | { | | f(); | | g(); | | } | | | | f() | | { | | vfork(); | | } | | | | g() | | { | | int blast[100],i; | | for (i = 0; i < 100; i++) | | blast[i] = i; | | } | +----------------------------------+ 9.29 8. , - 9.29, BSD 4.2 ? - ? 9. fork - -, ? ? *10. - , - , . , , , - . - . 11. "" - , . , , - ? *12. fork (), - ( pfdata) . , "" , (, ) - . . , - - , 288 , - - . , - , ? 13. , ? *14. . ? 15. , , , , . . 16. , - - , , , - "" . - . 17. VAX-11 - . ? 18. plock - ( ) - . "" - . , , , . ? , - ? 19. , 9.30 ? - , - . +------------------------------------------------------------+ | struct fourmeg | | { | | int page[512]; /* int 4 */ | | } fourmeg[2048]; | | | | main() | | { for (;;) | | { | | switch(fork()) | | { | | case -1: /* - | | * fork --- */ | | case 0: /* */ | | func(); | | default: | | continue; | | } } } | | | | func() | | { int i; | | | | for (;;) | | { | | printf(" %d \n",getpid()); | | for (i = 0; i < 2048; i++) | | fourmeg[i]290ge[0] = i; | | } } | +------------------------------------------------------------+ 289