Download presentation
Presentation is loading. Please wait.
1
Pipes One-way channel joining two processes
Read/write sends data “through” pipe Function pipe( ) establishes pipe int pipe (int filedes[ ]) filedes int[2] file descriptors identifies pipe. If pipe call successful filedes[0] opened for reading from the pipe, and filedes[1] opened to write to the pipe.
2
Connecting Processes Create the pipe Fork to create the reading child
In child, close the writing end of the pipe, and do any other required preparations In child, execute the child program In parent, close the reading end of the pipe If a second child is to write to the pipe, create that child, make appropriate preparations, and execute its program. If the parent is to write, do so at this time
3
Advanced Techniques Record Locking - process temporarily reserves part of a file for its own exclusive use. Message Passing - allows process to send and receive messages (bytes or characters). Semaphores - provides means for process synchronization Shared Memory - permits two or more processes to share data contained in specific memory segments.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.