CS 140 Midterm: CS 140cs140 midterm winter 2005

16 views8 pages
31 Jan 2019
Course
Professor

Document Summary

February 4th, 2005 (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. Initials:______: (10 points) in class i talked about how semaphores can be used to control the scheduling of a set of threads. The example i gave had three threads (t1,t2,t3) working together to compute print(f(x,y)): float x, y, z; sem sx = 0, sy = 0, sz = 0; Recode the above code using monitors rather than semaphores. Show the code for routines t1(), t2(), and t3() that use monitors to get the same functionality.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents