Topics in the mid-term: ~~~~~~~~~~~~~~~~~~~~~~~ Materials for the cs1550 midterm, TH section include all the material discussed in class, presented in the classnotes, and Chapters 1-3 from the Text Book Sample questions: ~~~~~~~~~~~~~~~~~ There MAY be several questions with short (true/false or numeric) answers, and a few questions requiring longer answers. A sample of the questions follow (note that this is just a sample, the midterm may or may not draw from these questions). SHORT-ANSWER QUESTION: 1. List the main functions of an Operating System 2. List 5 different system calls a generic OS provides 3. Do all OSs need to provide a graphical user interface (GUI)? 4. Give 2 examples of preemptive scheduling disciplines. 5. What is a non-preemptive scheduling discipline? 6. What is a PCB? 7. What is the main function of a PCB? 8. What is the main reason to have the PCB in the OS address space, instead of the user address space (a 1-line justification is required). 9. What is the difference between a thread (lightweight process) and a (heavyweight) process? 10. What is a semaphore? 11. What are the operations defined on a semaphore? 12. Can users update the variables defined as semaphores in their applications (source code)? 13. List the required conditions for critical sections. 14. Give an example of a deadlock by writing pseudo code with P and V operations and semaphores. List the semaphore declarations and initializations. 15. What is a resource allocation graph? LONG-ANSWER QUESTIONS: 1. Suggest a scheduling discipline that will minimize the average turnaround time of a fixed set of jobs that do not require any IO operations. State your assumptions. 2. Does your answer above change if the metric considered is the average response time? 3. What would you have to change from Unix or Windows (or other) operating systems if you wanted to use SJF as a scheduling discipline? Is this a reasonable thing to ask from the users? 4. Prove that SJF is the optimal scheduling algorithm for question 1. above. 5. How does a multi-level feedback queue (or just a feedback queue) can implement aging in preemptive scheduling? 6. Does aging have any effect in non-preemptive scheduling? Why or why not? 7. Give pseudo-code that implements counting semaphores based on the existence of binary semaphores. 8. Give pseudo-code that implements counting semaphores based on the existence of test-and-set operations. 9. Give pseudo-code that implements counting semaphores based on the existence of swap operations. 10. Give a pseudo-code solution to the Office Hours problem (defined in the programming assignment) 11. Give a pseudo-code solution to the Dining Philosophers problem (defined in the book) 12. How does a monitor work with respect to process synchronization? 13. How can the OS detect that a set of processes is in a deadlock (give a sketch of the algorithm and the assumptions you?re using) in a single processor environment. 14. What is a good technique that one can use if one does not want to use a detection/recovery technique to deal with deadlocks. Justify your answer. 15. Being able to work through an example of the Banker?s algorithm.