consider the following c program
登录 | 论坛导航 -> 华新鲜事 -> 社会百科 | 本帖共有 7 楼,当前显示第 5 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者:澳洲野狗 (等级:17 - 华新水桶,发帖:5289) 发表:2003-01-14 14:56:39  5楼 
是不是这样读到第一个fork(),program另外copy多一个fork();printf() so far, you have 1 parent program and exact same child program with the content---- fork(); printf(); each of them read upto second fork() will produce two children programs again, with the content---printf(); It's like a tree. 1 ^ 1 1 ^ ^ 11 11 After I tried this simply program in unix, i get the answer 4
updated
读到第一个fork(),program另外copy多一个fork();printf() so far, you have 1 parent program and exact same child program with the content---- fork(); printf(); each of them read upto second fork() will produce two children programs again, with the content---printf();(by now you will have 4 printf("hello!") After I tried this simply program in unix, i get the answer 4 It's like a tree. f:fork p:printf
如果你爱一个人,随遇而安,让他/她自由的飞,如果最后他/她还是回到你身边,那就是命中注定的。
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 7 楼,当前显示第 5 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码