Advanced Topics in Programming Languages: The Java Memory Model
ฝัง
- เผยแพร่เมื่อ 26 ส.ค. 2024
- Google Tech Talks
March 21, 2007
ABSTRACT
This talk describes the Java Memory Model and how it affects the ways concurrent software should be written. Recent changes to the memory model, which were incorporated into JDK 5, redefined the semantics of threads, synchronization, volatile variables, and final fields. The new memory model provides efficient and provably correct techniques for safely and correctly implementing concurrent operations. These techniques are compatible with existing good programming practice, although care needs to be taken in a couple of corner cases.
Most programmers can avoid depending on low-level details and instead just use the high-level concurrency abstractions provided in the new concurrency libraries. However, for those who have to write their own concurrency abstractions, understanding the building blocks of concurrency can be vitally important.
This talk will provide a simple and clear definition of what synchronization actually does, define the semantics of volatile variables and the java.util.concurrent.atomic package (and how they can be used to create efficient concurrent implementations), and describe how final fields can be used to provide thread-safe immutable objects without synchronization.
This talk is part of the Advanced Topics in Programming Languages series.
Google engEDU
Speaker: Jeremy Manson