lect17 - CMSC 216 Introduction to Computer Systems Lecture...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 216 Introduction to Computer Systems Lecture 17 Process Control Jan Plane & Pete Keleher {jplane,keleher}@cs.umd.edu Administrivia • EXAM #2 – Tuesday, November 8 – 1 week from today – Through System Level I/O (today’s material) • Read Chapter 11, Bryant and O'Hallaron 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Interprocess Communication • Processes can communicate with each other via various means, including signals and pipes • Signals have a limited "vocabulary" - only 64 signals on some machines; other limitations as well • Pipes allow arbitrary strings to be written from one process to another • Two kinds of pipes: FIFOs (or "named pipes", created by mkfifo() ), and anonymous pipes (often just called "pipes", created by pipe() ) 3 Pipes Note: much of this information is from the pipe man page, in section 7 (" man 7 pipe ") – the pipe() function discussed below is in section 2 Provide a unidirectional IPC channel, with a read end and a write end Created with the pipe() function: #include <unistd.h> int pipe(int fd[2]); fd needs to be an array of 2 elements – return value is 0 on success, -1 on error – On success, a new pipe is created, fd[0] will be the file descriptor for the read end, and fd[1] will be the file descriptor for the write end 4
Background image of page 2
Pipes, cont. • An anonymous pipe's file descriptors are only visible
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2012 for the course CMSC 216 taught by Professor Plane during the Spring '11 term at Maryland.

Page1 / 8

lect17 - CMSC 216 Introduction to Computer Systems Lecture...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online