Question: interprocess communication

Original link: http://www.cnblogs.com/GODYCA/archive/2013/01/04/2844178.html

We know the process has its own virtual address space, and interfere with each other, then how to achieve inter-process communication it? A and B can not see the address, the address can not see B and A, and how to access things that B of A, B and A, how to access something, I think it should have to use third-party stuff, we all know that the process's address space there is a kernel address, there is a kernel mode environment when the process state into the kernel mode user processes running, such as to call into the kernel mode to obtain kernel services through the system, the process kernel mode also has its own kernel stack, why the kernel stack it? Do not stack the user enough? Because many of the core services are protected, such as access to the page table, the process control block these things. But the kernel stack and inter-process communication and what is related to it? For all inter-process communication OS system call are implemented, all system calls to be caught in kernel mode execution.

Question: Pipeline is how to achieve inter-process communication?

Pipeline There are two forms, one can only communicate, there is a way to communicate between unrelated processes between parent and child, for the first pipeline, I believe that implementation should be able to speak a pipeline mapped into memory address, Both processes can read this one address, inter-process but must co-operate, a read write, can not read at the same time, while writing, parent and child can see this piece of memory, why you can see it? Because the parent process fork when a child process inherits the pipe descriptors, they are able to see. For the second pipeline, I think it can be mapped to the same file, but concrete is not very clear? Great God seeking explanation.

 

Reproduced in: https: //www.cnblogs.com/GODYCA/archive/2013/01/04/2844178.html

Guess you like

Origin blog.csdn.net/weixin_30588907/article/details/94787395