Tuesday, December 13, 2005

JMM

Whats the new JMM (JSR-133) all about?

Apparently the rules that govern the java memory these days have been changed. A brief list of the new rules:

  1. Volatile read/write instructions cannot be reordered with other instructions
  2. Synchronized blocks cannot be executed out of sequence with each other
  3. Writes that initialize final fields will not be reordered with operations following the freeze
  4. Every entry into a synchronised blocks trigger a flush of working memory so that all subsequent calls goto main memory
  5. Every exit out of synchronised blocks trigger a write of working memory to main memory
  6. All actions in a thread t1 should happen before any other thread (t2 say), successfully returns from a Thread.join() on thread t1.
Wonder how much of these were in the older JMM. I do know 1, 3 were not in the old specs, not sure abt the rest though.

Subscribe to comments for this post

No comments:

 
Clicky Web Analytics