Reputation: 165
If I ask for memory size of an int from malloc and I create 'n' child processes from one parent. Is it posible for each child to update(add one) the value inside that memory, so by the end the parent process reads the value?
Upvotes: 1
Views: 231
Reputation: 6298
No, there is no common memory between child and parent. To have a communication between child and parent you could use:
Shared memory // All POSIX systems, Windows
Pipes , (Example of Named Pipes) , Pipe tutorial // All POSIX systems, Windows
FIFO files // Most operating systems
sockets // Most operating systems
For more information on other methods check the Inter-process communication
Upvotes: 5