Rubric updates from Winter 2013 CS 140 at Stanford
[pintos-anon] / ta-advice / hw1.txt
index 28c30bf970b734c4f3fc4a594ccf3bf9a6300dcb..ff44b71c5ffdd4fdda8f908fc22348b404334b97 100644 (file)
@@ -9,8 +9,11 @@ OVERALL
     -10 Numerous capitalization, punctuation, spelling, or grammar errors
 
   DESIGN
+     -5 Gratuitous use of malloc()
     -10 Failure to check return value of malloc()
     -10 Use of ASSERT to check something that can actually fail, e.g. malloc()
+    -2: ASSERT() on user provided input (thread niceness)
+    -2: Re-enabling interrupts instead of returning them to their old value
 
   CODING STYLE
     -10 Inconsistent or bad coding style: no indentation, cramming
@@ -36,8 +39,11 @@ PROBLEM 1: ALARM CLOCK
      -2 A1: Forgot to include some declarations [which]
      -5 A2: Missing/non-responsive/too long/too short
      -5 A3: Missing/non-responsive/too long/too short
+     -5 A3: "non-responsive" if only mentioned micro optimizations, e.g. not
+        double checking conditions
      -5 A4: Missing/non-responsive/too long/too short
      -5 A5: Missing/non-responsive/too long/too short
+     -5 A5: correct mechanism but incorrect reasoning
      -5 A6: Missing/non-responsive/too long/too short
      -3 A6: "Straw man"--comparing correct design to an incorrect one
     -10 Claim or implication that list operations are atomic
@@ -47,15 +53,23 @@ PROBLEM 1: ALARM CLOCK
     -10 Interrupt handler always examines or modifies every waiting thread
      -5 Race between list modification and interrupt handler
     -10 A timer tick that occurs during list modification delays waking
-             threads until the next timer tick
+        threads until the next timer tick
     -10 Race between two threads modifying list
     -10 Wakes only one thread even if multiple are finished sleeping
     -15 Malfunctions (e.g. by busy waiting or not waiting the full time), 
-             even in corner case (e.g. when malloc() returns NULL)
+        even in corner case (e.g. when malloc() returns NULL)
     -15 Fixed limit on number of threads that may sleep
-     -5 Uses thread_block() instead of higher-level synchronization primitives
      -5 Disables interrupts unnecessarily
      -5 Unnecessary or redundant synchronization in timer_sleep()
+     -5 Implementation split across timer.c and thread.[ch]
+     -2 Doesn\92t check thread priorities when waking threads that cause
+        scheduling changes
+     -3 Checks for wakeups in \91schedule\92 and not \91timer_tick/thread_tick\92.
+        Hence there are a lot of spurious checks each time schedule is called.
+        This is probably why the tests passed too since the checks were too
+        frequent anyway.
+     -2 Interrupts turned off and on instead of storing the current level
+        and restoring the old level.
 
 Total deductions (capped at -30): XXX
 
@@ -89,11 +103,14 @@ PROBLEM 2: PRIORITY SCHEDULING
     -15 Grossly simplified design egregiously limits generality, e.g. small,
         fixed limit on total number of donations, donees, donor locks, etc.
      -5 Global list of donations is unnecessary and inefficient
+     -5 Donated priority is more than priority of donor
      -3 sema_up() yields regardless of whether a higher-priority
         thread was unblocked
      -5 sema_up() yields even when it does not unblock a thread
      -8 Race in lock_acquire() between priority donation and "down"ing sema
      -8 Race in lock_release() between release of donated pri and "up"ing sema
+    -10 Races in priority management code in general, i.e. no protection
+        when walking/updating priority graph
 
 Total deductions (capped at -30): XXX
 
@@ -123,10 +140,13 @@ PROBLEM 3: ADVANCED SCHEDULER
         once per second is unreadable
      -5 Code to update load average, recent_cpu, and thread priorities
         once per second is difficult to read
-     -5 Wastefully recalculates every thread's priority every 4th timer tick
+     -0 Wastefully recalculates every thread's priority every 4th timer tick
      -5 Race against timer interrupt in thread_get_recent_cpu() 
         or thread_get_load_avg()
+     -5 Failing to recompute current thread\92s priority every 4 ticks
+
         
 Total deductions (capped at -30): XXX
 
 Total score (100 - deductions): YYY
+