its not about compilers ... its that new kernels kills all the child processes, if parent gets killed before.. so that is the reason you are gettin diff reasons
On 5/24/12, himanshu kansal <[email protected]> wrote: > i know that the program sholud have printed "hello word" 8 times....bt whn > i run it, i get diffrnt reslts everytime and on diffrnt compilers....... > please tell the reason.... > > On Thu, May 24, 2012 at 11:11 AM, rajesh singarapu > <[email protected]>wrote: > >> main process have completed till the time all processes processes >> prints Hello World, >> >> to prevent it, use wait/wait4 family of fucntions. >> >> ~r >> >> On Thu, May 24, 2012 at 8:26 AM, Rajesh Kumar <[email protected]> >> wrote: >> > #include<stdio.h> >> > main() >> > { >> > fork(); >> > fork(); >> > fork(); >> > printf("Hello Word\n"); >> > } >> > >> > output --- >> > rajeshkumar@rajeshkumar-laptop:~$ ./a.out >> > Hello Word >> > Hello Word >> > Hello Word >> > rajeshkumar@rajeshkumarr-laptop:~$ Hello Word >> > Hello Word >> > Hello Word >> > Hello Word >> > Hello Word >> > >> > >> > Why it is not printed continously? >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Algorithm Geeks" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/algogeeks?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > > Regards > Himanshu Kansal > Msc Comp. sc. > (University of Delhi) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Thanks and Regards, Sumit Mahamuni. -- So once you do know what the question actually is, you'll know what the answer means. -- Perhaps the most important principal for good algorithm designer is to refuse to be content. - Aho, Hopcroft and Ullman. -- I love deadlines. I like the whooshing sound they make as they fly by. - D. Adams -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
