Download presentation
Presentation is loading. Please wait.
1
Inter-Process Communication Pipes Moti Geva geva.biu@gmail.com
Operating Systems Inter-Process Communication Pipes Moti Geva
2
Inter-Process Communiacation (IPC)
IPCs are mechanisms used to communicate between processes There are various kinds of IPC Files Pipes Signals System V IPC Shared memory Semaphore Message queues Sockets
3
(Anonymous) Pipes A kernel memory buffer No I/O involved.
Limited capacity. Blocks on Read: Empty pipe. Write: Full pipe. Unidirectional data channel. One fd for reading and one for writing.
4
pipe() system call NAME pipe - create pipe SYNOPSIS
#include <unistd.h> int pipe(int pipefd[2]); DESCRIPTION pipefd[0] refers to the read end of the pipe and pipefd[1] refers to the write end of the pipe. RETURN VALUE On success, zero is returned. On error, -1 is returned, and errno is set appropriately. Example: pipe.c
5
Named pipe (FIFO) When not father-child related
Accessed using the filesystem i.e. a special file Creation: mkfifo <fifoname> In C use mkfifo() - C-Library function mknod() system call.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.