324_Book

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e table in incremented from 1 to 2. When the parent closes its copy of the descriptor, the reference count is decremented from 2 to 1. Since the kernel will not close a file until the reference counter in its file table goes to zero, the child’s end of the connection stays open. Problem 12.6 Solution: [Pg. 640] When a process terminates for any reason, the kernel closes all open descriptors. Thus, the child’s copy of the connected file descriptor will be closed automatically when the child exits. Problem 12.7 Solution: [Pg. 652] The reason that standard I/O works in CGI programs is that we never have to explicitly close the standard input and output streams. When the child exits, the kernel will close streams and their associated file descriptors automatically. Problem 12.8 Solution: [Pg. 662] A. The doit function is not reentrant, because it and its subfunctions use the non-reentrant readline function. B. To make Tiny reentrant, we must replace all calls to readline with its reentrant counterpart readline r, being carefull to call readline rinit in doit before the first call to readline r. Bibliography [1] K. Arnold and J. Gosling. The Java Programming Language. Addison-Wesley, 1996. [2] V. Bala, E. Duesterwald, and S. Banerjiia. Dynamo: A transparent dynamic optimization system. In Proceedings of the 1995 ACM Conference on Programming Language Design and Implementation (PLDI), pages 1–12, June 2000. [3] T. Berners-Lee, R. Fielding, and H. Frystyk. Hypert...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online