stdout - fork() and printf() -
As I've understood a forek () the copy of the image of the original process has created a hair process.
My question is how does the child and parent process share the stdout stream?
Could the printf () function of a process be interrupted by another?
For example:
The first case:
or the printf () function is atomic?
Example:
The first case:
ex> guardian: printf ("hello"); Kids: printf ("world \ n"); In the console: HeWollorld
The second case:
Guardian: printf ("hello"); Kids: printf ("world \ n"); In the console: "Hello World"
printf ()
Not guaranteed to be nuclear If you need atom, use
Comments
Post a Comment