CMSC 412 Homework TwoName:Read Chapter 3Due Tuesday Sept 16.1. What interrupt is a geekos system call?2. The following is the first several lines of ps -alx on heaving.csic.umd.edu.F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND4 0 1 0 15 0 1532 500 - S ? 0:43 init5 0 2 0 -100 0 0 0 - SW ? 0:00 [migration/0]5 0 3 0 -100 0 0 0 - SW ? 0:00 [migration/1]1 0 4 1 15 0 0 0 - SW ? 0:00 [keventd]1 0 5 1 34 19 0 0 - SWN ? 0:00 [ksoftirqd/0]1 0 6 1 34 19 0 0 - SWN ? 0:00 [ksoftirqd/1]1 0 9 1 15 0 0 0 - SW ? 0:00 [bdflush]1 0 7 1 15 0 0 0 - SW ? 0:13 [kswapd]1 0 8 1 15 0 0 0 - SW ? 0:18 [kscand]1 0 10 1 15 0 0 0 - SW ? 0:41 [kupdated]1 0 11 1 25 0 0 0 - SW ? 0:00 [mdrecoveryd](a) What does the “F” stand for?(b) Is “migration” a high- or low-priority process?(c) What does the N in STAT signify?(d) Why are nearly all of these commands in square brackets?(e) (bonus question) Why do two processes have /0 and /1 suffixes?3. 3.3 When a process creates a new process using the fork() operations, which of the following states is sharedbetween the parent process and the child process? (a) stack (b) heap (c) shared memory segments.4. 3.4 With respect to the RPC mechanism, consider the “exactly once” semantic. Does the algorithm for implement-ing this semantic execute correctly even if the ACK message back to the client is lost due to a network problem?Describe the sequence of messages and discuss whether “exactly once” is still preserved.5. 3.6 Describe the differences among short-term, medium-term, and long-term scheduling.6. 3.7 Describe the actions taken by a kernel to context-switch between processes.7. 3.9 Including the initial parent process, how many processes are created by the [following program]:#include <unistd.h> // stdio totally not needed.int main() {fork(); fork(); fork();exit(EXIT_SUCCESS);}8. 3.11 Give an example of(a) a situation in which ordinary pipes are more suitable than named pipes, and(b) an example of a situtation in which named pipes are more suitable than ordinary pipes.Page 1 of 2CMSC 412 Homework Two9. 3.13 What’s printed by this program?#include <sys/types.h>#include <stdio.h>#include <unistd.h>int value = 5;int main() {pid_t pid = fork();if(pid == 0) {value += 15;} else if(pid > 0) {wait(NULL);printf("PARENT: value = %d", value);}exit(EXIT_SUCCESS);}Page 2 of
View Full Document