Concurrent Programming in Java from: NFJS Magazine 2011 March demo by: Keesun Baik(http//whiteship.me) email: firstname.lastname@example.org at: G+ Hang Out, 06.12.2011, 10 PM, Seoul
Java Concurrency• There are “Shared Mutable Variables” • So, “Synchronization” is required.• Monitor-based Concurrency Model • http://en.wikipedia.org/wiki/Java_concurrency
Software Transaction Memory• Remove “Synchronization” by • Change the “Shared Mutable Object” to “managed reference”. • A managed reference is not allowed to change in an uncontrolled manner.
Actor• Remove “Shared Mutable Object” by • Encapsulate variables within “Actor” • “Actors” are run only by one thread at any time. • So, there is no “contention”.
Sample• Sequentially call open API.• Monitor-based call open API.• STM-based call open API.• Actor-based call open API.
What do you think about?• Which way of concurrent programming do you prefer or looks attractive to you?• Which logic do you process concurrently?• What subjects should we learn about?• Which books do you use to learn concurrent programming?