From Ian Stark on October 17th, 2018
This lecture reviews the built-in Java concurrency primitives from Lecture 8 and introduces some patterns that can help with using them: immutability, synchronization wrappers, and control abstractions like producer/consumer. More high-level currency abstractions, such as those in the java.util.concurrent package, support programming that is not only thread-safe but takes explicit advantage of concurrency to increase performance and responsiveness.
There are still pitfalls around, though: race conditions and in particular data races that may cause problems in concurrent code. The abstractions described earlier can help manage these challenges, but sometimes at a performance cost. At the end there is a brief walk-through of some some intentionally racy code from the Java <code>String</code> library. This is an example of a “benign” data race which improves performance and, the creators believe, does not introduce surprise behaviour.Media Hopper Create does not support public attachments to videos, so to download slides please use this alternate website: https://wp.inf.ed.ac.uk/apl18/wp-content/uploads/sites/10/2018/10/apl18-9.pdf