{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

InClassActivity20-sol - In-Class Activity#20(Solution 12:04...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}