Midterm Spring 2003

Midterm Spring 2003 - Midterm Spring 2003 Name: Part 1....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Midterm Spring 2003 Name: Part 1. True False Questions Answer True/False (T/F) (1 point each) __F__ The call to putenv() in your shell can be called by a child process. __T__ spinlocks have less overhead than mutex-locks as long as the critical section is small. __F__ The check for permissions in the open() system call could be done in user space. __T__ If foo() calls xoo() and foo() has a local variable v1 and xoo() has a local variable v2, then &v1 > &v2 __T__ A call to fork() will show in the truss output. __F__ execvp() will return a value of 0 if successful. __T__ The counter of a semaphore could be negative at some point in the execution of a program. . __T__ Calling fork() modifies the reference counter of the open file objects. __F__ A parent and a child process may communicate using a pipe created by the child process. __F__ The size in bytes of a variable of type (char *) is 4 bytes and the size of a variable of type (char **) is 8 bytes. __T__ User-level threads use non-preemptive scheduling. __F__ ELF means Executable Level Format. _T/F___ SMP stands for Simultaneous Multi Processing (It should be "Symetric" instead of Simultaneous. Modify your class notes). __F__ A call to strcat(a,b) will allocate space with a number of bytes equal to the lenght of string "a" plus the lenght of string "b" plus 1. __T__ A process that has "n" POSIX threads, where one of them calls fork() will have only one thread in the child process. __F__ The number of processes in ready state in mentor cannot exceed 8. __T__ a[i] is equivalent to *(&a[0] + i) __T__ The input/output redirection to files can be done by the child. __F__ It is possible to disable interrupts in user space. __T__ BSS stores uninitialized global variables Part 2. Short questions. 1. (3 pts) Mention the advantages and disadvantages of clusters compared to multiprocessor machines. Advantage of cluster: 1. Inexpensive. Cost O(n) vs O(n^2) for mulitprocessor machines.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2. More reliability through redundancy. If one fails another can be used. 3. Easy to fix and replace a broken node. Disadvantage: 1. Slower communication vs. using shared memory in multiprocessor machines. 2. Multithreaded programs will not take advantage of a cluster. 3. Need to rewrite program to use cluster. 2. (3 pts.) Mention in what circumstances the user time of a process may exceed the real time. A multithreaded program running in a multiprocessor machine where different threads run concurrently in multiple processors may make the user time exceed the real time. 3. (3 pts.) Write the factors used to determine the length of a quantum.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue.

Page1 / 11

Midterm Spring 2003 - Midterm Spring 2003 Name: Part 1....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online