Section 4: Concurrency

1 Write code to define, instantiate, and start new threads using both java.lang.Thread and java.lang.Runnable.

1.1 Use java.lang.Thread to:
1.1.1 Define a thread
1.1.2 Instantiate a thread
1.1.3 Start a new thread
1.2 Use java.lang.Runnable to:
1.2.1 Define a thread
1.2.2 Instantiate a thread
1.2.3 Start a new thread

2 Recognize the states in which a thread can exist, and identify ways in which a thread can transition from one state to another.

2.1 Thread states
2.2 Thread state transitions

3 Given a scenario, write code that makes appropriate use of object locking to protect static or instance variables from concurrent access problems.

3.1 Synchronization of static variables
3.2 Synchronization of instance variables

4 Given a scenario, write code that makes appropriate use of wait, notify, or notifyAll.

4.1 Use of wait
4.2 Use of notify
4.3 Use of notifyAll


Warning: Access denied for user: 'dbo207131921@%' to database 'db207131921' query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Access denied for user: &amp;#039;dbo207131921@%&amp;#039; to database &amp;#039;db207131921&amp;#039;\nquery: INSERT INTO accesslog (title, path, url, hostname, uid, sid, timer, timestamp) values(&amp;#039;Section 4: Concurrency&amp;#039;, &amp;#039;node/443&amp;#039;, &amp;#039;&amp;#039;, &amp;#039;38.107.191.80&amp;#039;, 0, &amp;#039;cbeb579a90a620fb0ef4dc9b7d14ad6e&amp;#039;, 481, 1283994023)</em> in <em>/homepages/5/d207041726/htdocs/drupal-5.3/includes/database.mysql.inc</em> on line <em>172</em>.', 2, '', 'http://www.netzingers.com/home/works/jcp-study-notes/section-4-concurrency', '', '38.107.191.80', 1283994023) in /homepages/5/d207041726/htdocs/drupal-5.3/includes/database.mysql.inc on line 172

Warning: Access denied for user: 'dbo207131921@%' to database 'db207131921' query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Access denied for user: &amp;#039;dbo207131921@%&amp;#039; to database &amp;#039;db207131921&amp;#039;\nquery: INSERT INTO sessions (sid, uid, cache, hostname, session, timestamp) VALUES (&amp;#039;cbeb579a90a620fb0ef4dc9b7d14ad6e&amp;#039;, 0, 0, &amp;#039;38.107.191.80&amp;#039;, &amp;#039;messages|a:1:{s:5:\\&amp;quot;error\\&amp;quot;;a:1:{i:0;s:444:\\&amp;quot;user warning: Access denied for user: &amp;amp;#039;dbo207131921@%&amp;amp;#039; to database &amp;amp;#039;db207131921&amp;amp;#039;\\nquery: INSERT INTO accesslog (title, path, url, hostname, uid, sid, timer, timestamp) values(&amp;amp;#039;Section 4: Concurrency&amp;amp;#039;, &amp;amp;#039;node/443&amp;amp;#039;, &amp;amp;#039;& in /homepages/5/d207041726/htdocs/drupal-5.3/includes/database.mysql.inc on line 172