CS 140 Midterm: CS 140cs140 midterm winter 2002

35 views8 pages
31 Jan 2019
Course
Professor

Document Summary

February 11th, 2002 (total time = 50 minutes, total points = 50) In recognition of and in the spirit of the stanford university honor code, i certify that i will neither give nor receive unpermitted aid on this exam. This examination is close notes and close book. You may not collaborate in any manner on this exam. You have 50 minutes to complete the exam. Before starting, please check to make sure that you have all 8 pages. Cs140 midterm winter 2002: short answers (12 points, 4 points each) Cs140 midterm winter 2002: explain how position independent code (pic) helps in implementing shared libraries. Cs140 midterm winter 2002: synchronization (16 points) Consider a system that has many threads of two difference types (typea and typeb). All the threads call the below subroutine named routine passing their type as an argument. enum { typea, typeb} threadtype; Semaphore semax = 0; // initial value of semax is zero.