CS350 Study Guide - Midterm Guide: University Of Waterloo, Linearizability, Pseudocode
Document Summary
Student #: __ __ __ __ __ __ __ __ Make sure you answer it at the end: relax! Question 1 [10 marks] (a) [3 marks] )n os/(cid:883)(cid:888)(cid:883) there is a struct thread to represent a thread context and a struct trapframe to represent a trap frame. Describe something that is contained in both structures, and then for each of the structures describe something that it contains that the other does not. Briefly explain why each of the (cid:885) things you describe appears where it does. (b) [2 marks] on the m)ps + os/(cid:883)(cid:888)(cid:883) system, explain why a++ is not considered an atomic operation, yet v(s) is. Question 2 [15 marks] (a) [4 marks] there are three different ways a thread can transition from user mode to kernel mode. Write a small user program for os/(cid:883)(cid:888)(cid:883) that ensures that all three would occur during its execution and identify how each would occur.