784c5f101ab33825714dc39e3e9e3cad96c12594
[pintos-anon] / ta-advice / hw1.txt
1 HW1 DESIGN SUMMARY
2 ==================
3
4 OVERALL
5
6   DOCUMENTATION
7     -20 Egregious violation of style versus design document example
8     -10 Numerous excessively long lines (> 79 characters)
9     -10 Numerous capitalization, punctuation, spelling, or grammar errors
10
11   DESIGN
12     -10 Failure to check return value of malloc()
13     -10 Use of ASSERT to check something that can actually fail, e.g. malloc()
14
15   CODING STYLE
16     -10 Inconsistent or bad coding style: no indentation, cramming
17         many statements into one line, other issues at TA's discretion
18     -10 Numerous very long source code lines (> 100 characters)
19     -10 Commented-out or #if'd out code makes real code hard to read
20     -10 Many missing comments on structure, structure members, 
21         global or static variables, or function definitions
22     -10 Function(s) should be decomposed for clarity [indicate function]
23     -10 Cut-and-pasted code should be made into function [indicate where]
24     -10 Uninformative or deceptive identifiers
25
26 Subtotal: /10 (not capped)
27
28 PROBLEM 1: ALARM CLOCK
29
30   DOCUMENTATION
31     -30 Grossly inaccurate: documentation has no resemblance to code
32     -15 Important inaccuracies: documentation and code differ significantly
33         [indicate how]
34      -5 Minor inaccuracies: documentation and code differ [indicate how]
35      -5 A1: Missing entirely/missing comments or purpose/too long
36      -2 A1: Forgot to include some declarations [which]
37      -5 A2: Missing/non-responsive/too long/too short
38      -5 A3: Missing/non-responsive/too long/too short
39      -5 A4: Missing/non-responsive/too long/too short
40      -5 A5: Missing/non-responsive/too long/too short
41      -5 A6: Missing/non-responsive/too long/too short
42      -3 A6: "Straw man"--comparing correct design to an incorrect one
43     -10 Claim or implication that list operations are atomic
44
45   DESIGN
46     -30 Not implemented
47     -10 Interrupt handler always examines or modifies every waiting thread
48      -5 Race between list modification and interrupt handler
49     -10 A timer tick that occurs during list modification delays waking
50         threads until the next timer tick
51     -10 Race between two threads modifying list
52     -10 Wakes only one thread even if multiple are finished sleeping
53     -15 Malfunctions (e.g. by busy waiting or not waiting the full time), 
54         even in corner case (e.g. when malloc() returns NULL)
55     -15 Fixed limit on number of threads that may sleep
56      -5 Uses thread_block() instead of higher-level synchronization primitives
57      -5 Disables interrupts unnecessarily
58      -5 Unnecessary or redundant synchronization in timer_sleep()
59
60 Subtotal: /30 (capped at 0)
61
62 PROBLEM 2: PRIORITY SCHEDULING
63
64   DOCUMENTATION
65     -30 Grossly inaccurate: documentation has no resemblance to code
66     -15 Important inaccuracies: documentation and code differ significantly
67         [indicate how]
68      -5 Minor inaccuracies: documentation and code differ [indicate how]
69      -5 B1: Missing entirely/missing comments or purpose/too long
70      -2 B1: Forgot to include some declarations [which]
71      -5 B2: Missing/non-responsive/too long/too short
72      -3 B2: Diagram is difficult to follow
73      -3 B2: Diagram is not specific to the chosen design
74      -3 B2: Didn't include explanatory text, just a diagram
75      -3 B2: Didn't include diagram, just explanatory text
76      -5 B3: Missing/non-responsive/too long/too short
77      -3 B3: Didn't explain semaphores
78      -3 B3: Didn't explain locks
79      -3 B3: Didn't explain condition variables
80      -5 B4: Missing/non-responsive/too long/too short
81      -5 B5: Missing/non-responsive/too long/too short
82      -5 B6: Missing/non-responsive/too long/too short
83      -5 B7: Missing/non-responsive/too long/too short
84      -3 B7: "Straw man"--comparing correct design to an incorrect one
85
86   DESIGN
87     -30 Not implemented
88     -15 Malfunctions in corner case (e.g. when malloc() returns NULL)
89     -15 Grossly simplified design egregiously limits generality, e.g. small,
90         fixed limit on total number of donations, donees, donor locks, etc.
91      -5 Global list of donations is unnecessary and inefficient
92      -3 sema_up() yields regardless of whether a higher-priority
93         thread was unblocked
94      -5 sema_up() yields even when it does not unblock a thread
95      -8 Race in lock_acquire() between priority donation and "down"ing sema
96      -8 Race in lock_release() between release of donated pri and "up"ing sema
97
98 Subtotal: /30 (capped at 0)
99
100 PROBLEM 3: ADVANCED SCHEDULER
101
102   DOCUMENTATION
103     -30 Grossly inaccurate: documentation has no resemblance to code
104     -15 Important inaccuracies: documentation and code differ significantly
105         [indicate how]
106      -5 Minor inaccuracies: documentation and code differ [indicate how]
107      -5 C1: Missing entirely/missing comments or purpose/too long
108      -2 C1: Forgot to include some declarations [which]
109      -5 C2: Missing/non-responsive/too long/too short
110      -2 C2: Minor mistakes in table
111      -5 C2: Major mistakes in table
112      -5 C3: Missing/non-responsive/too long/too short
113      -5 C4: Missing/non-responsive/too long/too short
114      -5 C5: Missing/non-responsive/too long/too short
115      -3 C5: Did not mention advantage of submitted design
116      -3 C5: Did not mention disadvantage of submitted design
117      -5 C6: Missing/non-responsive/too long/too short
118      -5 C6: Did not properly justify failure to abstract fixed-point math
119
120   DESIGN
121     -30 Not implemented
122     -10 Code to update load average, recent_cpu, and thread priorities
123         once per second is unreadable
124      -5 Code to update load average, recent_cpu, and thread priorities
125         once per second is difficult to read
126      -5 Wastefully recalculates every thread's priority every 4th timer tick
127      -5 Race against timer interrupt in thread_get_recent_cpu() 
128         or thread_get_load_avg()
129
130 Subtotal: /30 (capped at 0)