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.

  1. are there differences between pipe , stream??
  2. 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 2 ints 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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -