全文预览

操作系统实验一、进程间的通信(共5页)

上传者:随心@流浪 |  格式:docx  |  页数:5 |  大小:0KB

文档介绍
lockf(fd[1],1,0);Р sprintf(OutPipe,"Subprocess p2 sent msg!\n");РР精选优质文档-----倾情为你奉上Р精选优质文档-----倾情为你奉上Р专心---专注---专业Р专心---专注---专业Р精选优质文档-----倾情为你奉上Р专心---专注---专业Р write(fd[1],OutPipe,50);Р sleep(1);Р lockf(fd[1],0,0);Р exit(0);Р }Р else{Р printf("parent\n");Р wait(0);Р read(fd[0],InPipe,50);Р printf("%s\n",InPipe);Р wait(0);Р read(fd[0],InPipe,50);Р printf("%s\n",InPipe);Р exit(0);Р }Р }РР}Рint main(){Р?//shiyan1_part1();Р?//shiyan1_part2_1();Р?//shiyan1_part2_2();Р?//shiyan1_part3_1();Р?//shiyan1_part3_2();Р //shiyan1_part4();Р?return 0;Р}Рvoid waiting(){Р while(wait_mark!=0);Р}Рvoid stop(){Р wait_mark=0;Р}

收藏

分享

举报
下载此文档