Pipes - PowerPoint PPT Presentation

1 / 3
About This Presentation
Title:

Pipes

Description:

Message Passing - allows process to send and receive messages (bytes or characters). Semaphores - provides means for process synchronization Shared Memory ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 4
Provided by: unt93
Learn more at: https://www.cse.unt.edu
Category:
Tags: message | passing | pipes

less

Transcript and Presenter's Notes

Title: Pipes


1
Pipes
  • One-way channel joining two processes
  • Read/write sends data through pipe
  • Function pipe( ) establishes pipe
  • int pipe (int filedes )
  • filedes int2 file descriptors identifies pipe.
  • If pipe call successful
  • filedes0 opened for reading from the pipe, and
  • filedes1 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.
Write a Comment
User Comments (0)
About PowerShow.com