DOC PREVIEW
UMD CMSC 412 - Homework #2

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

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

UMD CMSC 412 - Homework #2

Documents in this Course
Security

Security

65 pages

Deadlocks

Deadlocks

22 pages

Set 2

Set 2

70 pages

Project 2

Project 2

21 pages

Load more
Download Homework #2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework #2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework #2 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?