-
Notifications
You must be signed in to change notification settings - Fork 9
add cs350 spring 2013 midterm #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
777lefty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another concern: the exam seems to be dependent on OS/161, do we need to provide link to its codebase as supporting materials?
|
|
||
| (d) Give one advantage and one disadvantage of having a software design with high lock granularity (many locks). | ||
|
|
||
| (e) Briefly explain what this line of code is doing and why: tf->tf_v0 = retval; in a MIPS syscall handler context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code block here better?
| VPAGE bits 44-63 | ||
| PFRAME bits 12-31 | ||
| DIRTY bit 10 | ||
| VALID bit 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code block here better
| flag[tid] = 1; | ||
| while (turn != tid && flag[1 - tid]) { } | ||
| /* critical section */ | ||
| flag[tid] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code block here better
|
|
||
| (a) [4 Marks] Give a proof as to why resource ordering can prevent deadlocks. It can be informal, but it should be sound. You are not required to reference the deadlock detection algorithm, but you may reference it if you choose. | ||
|
|
||
| (b) [4 Marks] Here is Peterson’s algorithm as presented in class. Your friend has implemented Peterson’s algorithm for OS/161 as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peterson's algorithm is not provided?
|
|
||
| ## Question 4 [7 point(s)] | ||
|
|
||
| (a) [2 Marks] Concisely explain how in your A1 cat/mouse solution the decision was made to switch from allowing one animal to eat (i.e., cats) to the other animal eating (i.e., mice). If you did not complete assignment 1, describe the naïve solution discussed in class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this problem is assignment-dependent, can we add it or not?
|
|
||
| (a) [2 Marks] Concisely explain how in your A1 cat/mouse solution the decision was made to switch from allowing one animal to eat (i.e., cats) to the other animal eating (i.e., mice). If you did not complete assignment 1, describe the naïve solution discussed in class. | ||
|
|
||
| (b) [1 Mark] Given the above specifications and that (c >> b) and (m >> b), describe any circumstances under which your solution described in (a) would achieve its maximum efficiency, and then calculate that efficiency as a formula using the variables c, m, b and t as necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifications above is not provided
| "answer": "(a) The decision was based on a policy that allows a bounded number of consecutive eaters of one species before switching to the other to prevent starvation and improve throughput; the naive solution would let one species eat indefinitely, which can starve the other. (b) Maximum efficiency occurs when bowl turnover and scheduling produce no idle time between eaters; with c >> b and m >> b and negligible switching overhead, efficiency approaches 1 (i.e., bowls almost always in use). The precise formula depends on how many bowls are used in parallel and the switching overhead; in the ideal alternating steady state efficiency = useful eating time / total time. (c) For each scenario compute efficiency and max wait times based on k, b, t, c, m and the scheduling described. (Full numeric answers depend on following the outlined calculation for each scenario.)", | ||
| "llm_judge_instructions": "(a) 2 pts: award 1 pt for describing the switching decision mechanism and 1 pt for justification (preventing starvation/improving throughput). (b) 1 pt: award for identifying circumstances and deriving a correct formula or clear expression. (c) 4 pts total: 1 point per scenario. For each scenario, award the 1 point if the student provides the correct efficiency and both correct maximum wait times; award 0.5 if some but not all of those three values are correct with clear reasoning. Provide brief annotations for partial credit. Total = 7 points." | ||
| } | ||
| ``` No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more feasible problems skipped?
Description
Add CS350 Spring 2013 Midterm exam assets and metadata to the course exam benchmark.
Changes
Testing
Prepared the dataset and validated ingestion by running: python3 courseexam/prepare.py
Checklist