Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Concurreny Library9-14-2011Opening DiscussionMinute essay commentsCores and stressing machines.IcP solutionsMotivationThe future is parallel.Core counts are growing but clock speed isn't and neither is single thread performance.Software developers are behind the curve on this.wait/notifyAllAllows synchronization between threads. A thread can wait and it won't restart until another thread notifies it.Put wait in while loop that checks a Boolean flag.Always use notifyAll instead of notify. Failure to do so leads to deadlocks.These must be called from inside of a synchronized block.java.util.concurrentJava 5 added the java.util.concurrent package and others below it.Provides better ways to do common tasks for parallel.ExecutorsUse the proper one of these to start threads instead of making them manually.Allows Callable[A] and Future[A] which return a value.Parallel Data StructuresBlockingQueueConcurrentMapCountDownLatchCyclicBarrierExchangerPriorityBlockingQueueSemaphoreScala provides some support for basic collections.LocksMore flexible than synchronized.Provides extra power when needed. Particularly for locking across method calls.AtomicsData values with atomic access.Faster and easier than doing your own synchronization.CodeI want to get commands working so that we can play with some of this in the drawing program.Minute EssayHow might you break parts of your project code into different threads to take advantage of many
View Full Document