Home > OS >  On Linux fork () the problem o god answers
On Linux fork () the problem o god answers

Time:10-21

Why run two programs, the result is so?

CodePudding user response:

What is your problem???

CodePudding user response:

Is my this two programs run why the result of the difference is so big,
The first is:
for(int i=0; i 1023; I++)
{
Putchar (' A ');
}
Putchar (" B ");
Fork ();
The output of this program are as follows:
AAAAAAAAAA...
AAAA AAAAAA...
. AAA

And why is this: another program
for(int i=0; i 1024; I++)
{
Putchar (' A ');
}
Putchar (" B ");
Fork ();
The result is:
AAAAAAA...
. AAA BB
Why the second only output the result of the 1023 A and two B
Results the difference so big and the first time
  • Related