CS201J: Engineering Software, Fall 2003
|
Notes: Tuesday 28 October 2003
Schedule Revisions: The schedule below reflects changes from the original schedule:
Schedule
- Problem Set 6 will be the last problem set; there is no Problem Set 7.
- Exam 2 will be handed out on Tuesday, 2 December, and due on Friday, 5 December. Exam 2 will be comprehensive, but similar in length and format to Exam 1. There will be no final exam. Students who believe they would benefit from having a final exam should meet with me (before December 2) to arrange an alternative.
Programming Concurrency
- Thursday, 30 October: PS5 Part 1
- Tuesday, 11 November: PS5 Part 2
- Tuesday, 18 November: No class
- Tuesday, 25 November: PS6 Due
- Tuesday, 2 December: Exam 2 Out
- Friday, 5 December: Exam 2
class Counter { private int count; public Counter () { count = 0; } public void increment () { count++; } public void decrement () { count--; } public int getValue () { return count; } } class IncThread extends Thread { private Counter c; public IncThread (Counter p_c) { c = p_c; } public void run () { while (true) { c.increment (); System.err.println ("Running inc thread: " + currentThread () + " / Value: " + c.getValue ()); } } } class DecThread extends Thread { private Counter c; public DecThread (Counter p_c) { c = p_c; } public void run () { while (true) { c.decrement (); System.err.println ("Running dec thread: " + currentThread () + " / Value: " + c.getValue ()); } } } public class Yarn { public static void main (String args[]) { Counter c = new Counter (); IncThread ithread = new IncThread (c); DecThread dthread = new DecThread (c); ithread.start (); dthread.start (); } }
University of Virginia Department of Computer Science CS 201J: Engineering Software |
Sponsored by the National Science Foundation |
cs201j-staff@cs.virginia.edu |