This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2003 Page 1 of 1 In-Class Activity #20 (Solution) 4/9/2003 12:04 PM Activity 20.1 Inter-process communication a. How is a pipe implemented? The two processes share a FIFO (first-in, first-out) buffer. b. What would happen if a pipe were implemented using a LIFO (last in, first out) buffer? The data would be scrambled! In the worst case, the second process would receive what it expects in reverse order. c. Rewrite the equivalent of the UNIX command diff file1 file 2 using a pipe. cat file1 | diff file2 (the first parameter of diff is replaced by the pipe). d. Can there be two-way communication over a single pipe? Explain your reasons. No. A FIFO buffer or queue is essentially unidirectional. e. What is a file descriptor? How many bits does it contain? A file descriptor is an integer-valued index into a table of open files (for a specific process). This table contains the file name, status, user rights, and the current location of the read and write pointers. The table itself is part of the PCB. The name, status, user rights, and the current location of the read and write pointers....
View Full Document
This note was uploaded on 04/25/2010 for the course ECSE ecse-2340 taught by Professor Wozny during the Spring '09 term at Rensselaer Polytechnic Institute.
- Spring '09