Comprehensive Core Exam
CSCI 640, Operating Systems
Study Guide
Spring 2008
Contact:  Tyson Henry  trhenry@csuchico.edu

The Operating Systems (CSCI 640) portion of the Comprehensive Core Exam (CCE) will test students on a broad range of Unix systems programming topics.  The test will offer students a choice of questions to answer, so students will not be expected to answer questions on every exam topic.

There will be two types of questions:  (1) topic questions and  (2) questions in which students solve a problem using C/C++ or pseudo-code.

You don't have to remember the names or syntax of system calls.  If you forget the name of a function, you can comment what it does or give it a descriptive name.  For example, readdir() returns the next item from an open directory.  If you forgot the name of the function you could write something like this:

get_next(my_directory) // return next entry in the directory

Or if you forgot the name of the fork() function, you could write:

child_pid = create_new_process()


Exam Topics (only topics in this list and problems on these topics will be on the exam)

  1. Memory management (run-time stack, memory heap, local variables, global variables)
  2. Unix Processes (creation, termination, joining, exec function)
  3. POSIX Threads (Pthreads)
  4. Thread Synchronization (conditional variables)   
  5. Files
  6. Directories (opening, reading)
  7. Pipes
  8. Signals (handling, generating)
  9. Critical Sections and Semaphores
  10. Producer-Consumer Synchronization
  11. Connection-Oriented Communication  (sockets)
 

Example Topic Questions

  1. What is a Unix signal?
  2. How are a thread and a process different?  What are advantages of threads over processes?
  3. Describe the concept of a semaphore.  Include a description of how they are used.
  4. Describe the concept of a Unix pipe.  Explain how they can be used to provide producer-consumer synchronization.
  5. What does it mean if a set of process are deadlocked?
  6. Describe the waitpid() function.  Mention both the blocking and non-block behavior.
  7. Outline the critical section problem.  Give an example of a solution to this problem.
  8. If two 20 byte messages are sent on a socket connection, how many messages will be received at the other end?
  9. Draw a diagram of the memory segment of a process.  Include the runtime-stack, dynamic memory, and global variables.


Example problem solving questions

  1. Write code that creates a child process that performs a calculation (such as adding two numbers).  Have the parent process wait for the child process to finish and perform a calculation using the result of the calculation performed by the child.  Clearly document how the result is communicated from the child process to the parent process.  Assume the result of the calculation the child process performs is a double.
  2. The dining philosophers problem is summarized as five philosophers sitting at a table doing one of two things - eating or thinking. While eating, they are not thinking, and while thinking, they are not eating. The five philosophers sit at a circular table with a large bowl of spaghetti in the center. A fork is placed in between each philosopher, and as such, each philosopher has one fork to his or her left and one fork to his or her right. As spaghetti is difficult to serve and eat with a single fork, it must be assumed that in order for a philosopher to eat, the philosopher must have two forks. In the case of the dining philosopher, the philosopher can only use the fork on his or her immediate left or right.  Assuming each philosopher is represented by a process and each fork is a limited resource, write a code segment that uses semaphores to provide the synchronization necessary to solve this problem.  Make sure your solution does not deadlock.
  3. Using Pthreads write a program that demonstrate a race condition.
  4. When a process terminates the parent process receives a SIGCHLD signal.  When a process terminates the operating system does not completely delete it until the process' parent performs a wait() for it.  Write a program that forks several processes and uses the SIGCHLD signal to make sure wait() is called for each terminated child.  Assume the parent process continually prompts the user for a word and then prints the word until the user enters ^D (EOF).  This last assumption means that you can't have the parent block on the wait() command, you must use the SIGCHLD signal.

Other Resources

The 640 CCE is written so that both Professor Hilzer's 640 students and my 640 sudents can succeed.

However, if you took 640 from Professor Hilzer, then you might want to look at the exams I've given in 640 to learn how I write exams.

www.ecst.cuschico.edu/~tyson/classes/640.f07
www.ecst.cuschico.edu/~tyson/classes/640.s08

I would not expect students who took Professor Hilzer's course to be able to answer all the questions on my 640 exams.  However, looking at the exams will give you an idea of the types of questions I ask.