Advanced Topics in Programming Languages: The Java Memory...
ฝัง
- เผยแพร่เมื่อ 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... - แนวปฏิบัติและการใช้ชีวิต
Yes, however in 1.4 final did not offer the same guarantees as it does now, so the default value of that field type (in this case 0) could be seen.
Hi James,
One question regarding slide - Ordering(Why that slide was wrong)
There is a line that- Reentrant lock is no-op
Assuming that a JVM does nothing in no-op, but my understating is that(Correct me if I am wrong) it must be increasing lock counter some where, and this counter is checked to reach 0 while exiting the synchronize block/method to release the lock, if it does not reach zero,lock wont be released.
Thanks,
Tarun
interesting point about volatile increments at 38:50
@ae6rt - At 47:00 , I could not get the "/tmp/usr" substring attack. Even Java 1.4 String was final. ??
good
no synchronization is always a Bug????? I don't agree
First I thought he was wearing a white mask.
not advanced...