aren't two programs same ? and scheduling of two forked and parent process
is prcoessor dependent. You dont have a say in it.
On Sun, Aug 14, 2011 at 1:21 AM, thanu moorthy <[email protected]>wrote:
> #include<stdio.h>
> #include<unistd.h>
> int main()
> {
> int return_value;
> printf("forking process");
> fork();
> printf("hello\n");
> return 0;
>
> }
>
> in the above program the output is
>
> forking processhello
> forking processhello
>
> but in the below prog
>
>
> include<stdio.h>
> #include<unistd.h>
> int main()
> {
> int return_value;
> printf("forking process\n");
> fork();
> printf("hello\n");
> return 0;
>
> }
> the output is
> forking process
> hello
> hello
>
> why its so ??
>
> --
> by $THANU$
>
> --
> 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.
>
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
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.