multiprocessing - What is the difference between stream and pipe in C -
in inter process communication(ipc), communicate each process "pipe" os provides should needed. , transmit data input unit program or program output unit "stream" os provides should needed.
here questions.
- are there differences between pipe , stream??
- if different, because functions similar isn't more useful using "pipe" or "stream" transmit data??
a pipe communication channel between 2 processes. has writing end , reading end. when on open 1 of these 2 end, 1 (writing or reading) stream. in first approximation there stream @ each end of pipe.
so set ipc, should
- create pipe using function
pipe
. return 2int
s identifying 2 ends of pipes; - usually fork 2 processes;
- open each end of pipe (usually in different process after forking) , 2 corresponding streams.
see http://www.gnu.org/software/libc/manual/html_node/creating-a-pipe.html
Comments
Post a Comment