是不是这样
所在版块:社会百科 发贴时间:2003-01-14 14:48

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
读到第一个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
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

如果你爱一个人,随遇而安,让他/她自由的飞,如果最后他/她还是回到你身边,那就是命中注定的。
 相关帖子 我要回复↙ ↗回到正文
consider the following c program 张翠山   (87 bytes , 259reads )
pls refer to cs2106 lecture notes II. W风R雨S雪   (0 bytes , 236reads )
[A]BECAUSE YOU FORK() TWICE, YOU HAVE 不告诉你   (48 bytes , 159reads )
是不是这样 澳洲野狗   (371 bytes , 160reads )
updated 澳洲野狗   (463 bytes , 126reads )
[AGREE]EXACTLY. 不告诉你   (0 bytes , 156reads )
谢谢! 张翠山   (0 bytes , 125reads )