Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 자식 프로세스 소스입니다.
- #include <stdio.h>
- int main()
- {
- int a=0,x,y,z;
- for(x=0; x<100; ++x)
- {
- printf("*");
- for(y=0; y<1000; ++y)
- {
- for(z=0; z<1000; ++z)
- a=x*y*z*y*z+(x+y+z)-99*x+x*y*z/97;
- }
- }
- return 0;
- }
- 부모 프로세스입니다.
- #include<stdio.h>
- #include<unistd.h>
- #include<sys/types.h>
- int main()
- {
- int a=0,x,y,z;
- pid_t pid;
- pid = fork();
- if(pid<0)
- {
- fprintf(stderr,"Fork faild!!\n");
- exit(-1);
- }
- else if(pid==0)
- {
- execlp("./OS_process_child", "OS_process_child", NULL);
- }
- else
- {
- for(x=0; x<100; ++x)
- {
- printf("-");
- for(y=0; y<1000; ++y)
- {
- for(z=0; z<1000; ++z)
- a=x*y*z*y*z+(x+y+z)-99*x+x*y*z/97;
- }
- }
- wait(NULL);
- printf("Parent\n");
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement