Midterm Fall 2001

Midterm Fall 2001 - Midterm Fall 2001 Name: 1. Answer...

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

View Full Document Right Arrow Icon
Midterm Fall 2001 Name: 1. Answer True/False (T/F) (1 point each) _ F__ The size in bytes of a variable of type (char *) is 1 byte. _T__ In a C program the expressions a[i] and *(a + i) are equivalent. _T__ The strdup function calls malloc. _F__ On a 1-CPU computer, a program that runs in time T will run in time T/n if decomposed in n threads. _F__ The "S" in SMP stands for Simultaneous. _F__ A call to "strcmp" will show in the truss output. _T__ The time command in mentor could show that the user time is larger than the real time. _T__ A long time quantum may cause a program to finish sooner. _T__ The arguments of a system call are checked in kernel mode. _F__ The file descriptors of a process are closed when a process calls execvp(). _T__ A process that uses pipes may hang due to unclosed file descriptors. _T__ A program that runs with non preemptive scheduling runs faster than one with preemptive scheduling. _F__ Most of the processes' CPU bursts do not finish before a context switch. _F__ Programs that run round-robin scheduling have faster average response time than programs that run SJF. _F__ When a process calls fork, the number of open file objects in the kernel is duplicated. _F__ POSIX threads are better than Solaris threads because the former are faster. _T__ The input/output redirection to files can be done by the child. _T__ Kernel threads in a process share the same file descriptors. _F__ A section of code that is guarded by sema_wait/sema_post calls can be executed by only one thread at a time. _F__ A process table entry contains one set of registers for each user and kernel level thread in a process. 2. (3 pts.) Enumerate the fields of a process table entry Process ID Process state Saved Registers File Descriptors Page Table
Background image of page 1

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

View Full DocumentRight Arrow Icon
3. (3 pts.) Mention the checks done by the kernel during the open() system call. . File Permissions: If the file is opened in write-mode, the user should have write permissions to the file either as user, group or others. The same for read-mode. If fthe file is opened with the flag O_CREAT and the file does not exist, the user should have write permisisons to the directiory the file will be created into. 4. (3 pts.) What are the steps involved in a context switch?
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 / 7

Midterm Fall 2001 - Midterm Fall 2001 Name: 1. Answer...

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