HW1 - environment variables and current working directory...

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

View Full Document Right Arrow Icon
ECEC-353: Systems Programming Solutions to Homework Set 1 July 14, 2011 Textbook problem 3.9. The program will generate eight (8) processes. Textbook problem 3.10. At line A, pid = 0; at line B, pid 1 = 2603; at line C, pid = 2603 (fork() returns the process ID of the child process to the parent); and line D, pid 1 = 2600. Textbook problem 3.13. The output at Line A will be value = 5. (Since fork() duplicates the entire address space of the parent, the parent and the child operate on separate copies of the variable value .) Textbook problem 4.7. Any kind of sequential program is not a good candidate to be threaded. An example of this is a program that calculates an individual tax return. Another example is a “shell” program such as the C-shell or Korn shell. Such a program must closely monitor its own working space such as open files,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: environment variables, and current working directory. Textbook problem 4.10. The threads of a multi-threaded process share heap memory and global variables. Each thread has its separate set of register values and a separate stack. Textbook problem 4.11. A multi-threaded system comprising of multiple user-level threads cannot make use of the different processors in a multiprocessor system simultaneously. The operating system sees only a single process and will not schedule the different threads of the process on separate processors. Consequently, there is no performance benefit associated with executing multiple user-level threads on a multiprocessor system. Textbook problem 4.13. At line C, value = 5, and at line P, value = 0. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online