Updated to use Bochs 2.6.11
[pintos-anon] / doc / threads.tmpl
index 9d421f62e2be32ddd3409af47ea1e5f338794cdb..f87f464260a24657009c724b56815beef1857e29 100644 (file)
@@ -1,9 +1,9 @@
-                       +--------------------+
-                       |        CS 140      |
-                       | PROJECT 1: THREADS |
-                       |   DESIGN DOCUMENT  |
-                       +--------------------+
-                                  
+            +--------------------+
+            |        CS 140      |
+            | PROJECT 1: THREADS |
+            |   DESIGN DOCUMENT  |
+            +--------------------+
+
 ---- GROUP ----
 
 >> Fill in the names and email addresses of your group members.
 ---- GROUP ----
 
 >> Fill in the names and email addresses of your group members.
@@ -19,86 +19,88 @@ FirstName LastName <email@domain.example>
 
 >> Please cite any offline or online sources you consulted while
 >> preparing your submission, other than the Pintos documentation, course
 
 >> Please cite any offline or online sources you consulted while
 >> preparing your submission, other than the Pintos documentation, course
->> text, and lecture notes.
+>> text, lecture notes, and course staff.
 
 
-                            ALARM CLOCK
-                            ===========
+                 ALARM CLOCK
+                 ===========
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> A1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> Briefly describe what happens in a call to timer_sleep(), including
->> the effects of the timer interrupt handler.
+>> A2: Briefly describe what happens in a call to timer_sleep(),
+>> including the effects of the timer interrupt handler.
 
 
->> What steps are taken to minimize the amount of time spent in the timer
->> interrupt handler?
+>> A3: What steps are taken to minimize the amount of time spent in
+>> the timer interrupt handler?
 
 ---- SYNCHRONIZATION ----
 
 
 ---- SYNCHRONIZATION ----
 
->> How are race conditions avoided when multiple threads call
+>> A4: How are race conditions avoided when multiple threads call
 >> timer_sleep() simultaneously?
 
 >> timer_sleep() simultaneously?
 
->> How are race conditions avoided when a timer interrupt occurs during a
->> call to timer_sleep()?
+>> A5: How are race conditions avoided when a timer interrupt occurs
+>> during a call to timer_sleep()?
 
 ---- RATIONALE ----
 
 
 ---- RATIONALE ----
 
->> Why did you choose this design?  In what ways is it superior to
+>> A6: Why did you choose this design?  In what ways is it superior to
 >> another design you considered?
 
 >> another design you considered?
 
-                        PRIORITY SCHEDULING
-                        ===================
+             PRIORITY SCHEDULING
+             ===================
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> B1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 
->> Explain the data structure used to track priority donation.  Use ASCII
->> art to diagram a nested donation.
+>> B2: Explain the data structure used to track priority donation.
+>> Use ASCII art to diagram a nested donation.  (Alternately, submit a
+>> .png file.)
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> How do you ensure that the highest priority thread waiting for a lock,
->> semaphore, or condition variable wakes up first?
+>> B3: How do you ensure that the highest priority thread waiting for
+>> a lock, semaphore, or condition variable wakes up first?
 
 
->> Describe the sequence of events when a call to lock_acquire() causes a
->> priority donation.  How is nested donation handled?
+>> B4: Describe the sequence of events when a call to lock_acquire()
+>> causes a priority donation.  How is nested donation handled?
 
 
->> Describe the sequence of events when lock_release() is called on a
->> lock that a higher-priority thread is waiting for.
+>> B5: Describe the sequence of events when lock_release() is called
+>> on a lock that a higher-priority thread is waiting for.
 
 ---- SYNCHRONIZATION ----
 
 
 ---- SYNCHRONIZATION ----
 
->> Describe a potential race in thread_set_priority() and explain how
->> your implementation avoids it.  Can you use a lock to avoid this race?
+>> B6: Describe a potential race in thread_set_priority() and explain
+>> how your implementation avoids it.  Can you use a lock to avoid
+>> this race?
 
 ---- RATIONALE ----
 
 
 ---- RATIONALE ----
 
->> Why did you choose this design?  In what ways is it superior to
+>> B7: Why did you choose this design?  In what ways is it superior to
 >> another design you considered?
 
 >> another design you considered?
 
-                         ADVANCED SCHEDULER
-                         ==================
+              ADVANCED SCHEDULER
+              ==================
 
 ---- DATA STRUCTURES ----
 
 
 ---- DATA STRUCTURES ----
 
->> Copy here the declaration of each new or changed `struct' or `struct'
->> member, global or static variable, `typedef', or enumeration.
->> Identify the purpose of each in 25 words or less.
+>> C1: Copy here the declaration of each new or changed `struct' or
+>> `struct' member, global or static variable, `typedef', or
+>> enumeration.  Identify the purpose of each in 25 words or less.
 
 ---- ALGORITHMS ----
 
 
 ---- ALGORITHMS ----
 
->> Suppose threads A, B, and C have nice values 0, 1, and 2.  Each has a
->> recent_cpu value of 0.  Fill in the table below showing the scheduling
->> decision and the priority and recent_cpu values for each thread after
->> each given number of timer ticks:
+>> C2: Suppose threads A, B, and C have nice values 0, 1, and 2.  Each
+>> has a recent_cpu value of 0.  Fill in the table below showing the
+>> scheduling decision and the priority and recent_cpu values for each
+>> thread after each given number of timer ticks:
 
 timer  recent_cpu    priority   thread
 ticks   A   B   C   A   B   C   to run
 
 timer  recent_cpu    priority   thread
 ticks   A   B   C   A   B   C   to run
@@ -114,26 +116,29 @@ ticks   A   B   C   A   B   C   to run
 32
 36
 
 32
 36
 
->> Did any ambiguities in the scheduler specification make values in the
->> table uncertain?  If so, what rule did you use to resolve them?  Does
->> this match the behavior of your scheduler?
+>> C3: Did any ambiguities in the scheduler specification make values
+>> in the table uncertain?  If so, what rule did you use to resolve
+>> them?  Does this match the behavior of your scheduler?
+
+>> C4: How is the way you divided the cost of scheduling between code
+>> inside and outside interrupt context likely to affect performance?
 
 ---- RATIONALE ----
 
 
 ---- RATIONALE ----
 
->> Critique your design, pointing out advantages and disadvantages in
->> your design choices.  If you were to have extra time to work on this
->> part of the project, how might you choose to refine or improve your
->> design?
+>> C5: Briefly critique your design, pointing out advantages and
+>> disadvantages in your design choices.  If you were to have extra
+>> time to work on this part of the project, how might you choose to
+>> refine or improve your design?
 
 
->> The assignment explains arithmetic for fixed-point math in detail, but
->> it leaves it open to you to implement it.  Why did you decide to
->> implement it the way you did?  If you created an abstraction layer for
->> fixed-point math, that is, an abstract data type and/or a set of
->> functions or macros to manipulate fixed-point numbers, why did you do
->> so?  If not, why not?
+>> C6: The assignment explains arithmetic for fixed-point math in
+>> detail, but it leaves it open to you to implement it.  Why did you
+>> decide to implement it the way you did?  If you created an
+>> abstraction layer for fixed-point math, that is, an abstract data
+>> type and/or a set of functions or macros to manipulate fixed-point
+>> numbers, why did you do so?  If not, why not?
 
 
-                          SURVEY QUESTIONS
-                          ================
+               SURVEY QUESTIONS
+               ================
 
 Answering these questions is optional, but it will help us improve the
 course in future quarters.  Feel free to tell us anything you
 
 Answering these questions is optional, but it will help us improve the
 course in future quarters.  Feel free to tell us anything you