This is very technical, most likely way past what 99% of developers both need to care about and have to care about.
Given that most developers work at best with embarrassingly parallel problems they wouldn't need to know much of these details.
But if you're up for it: It's a very rewarding feeling when you're both allowed to figure these things out and someone are also paying you while you figure it out.
Was the English version of this talk recorded? I found the talk in Russian[1], but with my understanding of the Russian language, it's impossible to watch.
In the section about nasal demons, did anyone else think the right answer was 12 too? I figured the parens make the context local so the ++ had to occur after the add.
The memory model seems to be the real achilles heel for concurrency in Java. In the end with a only little bit of work one can master the concurrency primitives and they are quite usable. However understanding the full ramifications of the memory model is pretty much beyond mere mortals. As a result it is hard to do anything else than stick to established patterns and / or toolkits and frameworks if you don't want to set yourself up for insidious issues that are nearly impossible to reproduce.
Au contraire, the fact that Java actually has a memory model means one can reason about concurrency in a way impossible on other platforms.
As you note you rarely need to concern yourself with the details of the memory model as most of us are users, not designers, of concurrency primitives. But you should you need to design a new primitive you can actually have some guarantees it will work in a cross-platform manner, which is more than you an say about any other platform I know of.
The memory model is actually relatively straightforward on the user side; it's significantly more complicated on the implementer side.
In most cases you can get away with coarser constructs (which are higher-performing anyway, eg task parallelism vs. trying to decompose an individual operation) and only dive into the language lawyering semantics when you, eg, really really need a lockfree concurrent linked list.
> The memory model seems to be the real achilles heel for concurrency in Java.
I'd expand it beyond Java to shared-everything models in general. Any language with a shared-everything model is going to incur all this complexity. At least Java goes through this pain to ensure memory safety in the presence of unsynchronized accesses from multiple threads.
[+] [-] theocs|11 years ago|reply
Given that most developers work at best with embarrassingly parallel problems they wouldn't need to know much of these details.
But if you're up for it: It's a very rewarding feeling when you're both allowed to figure these things out and someone are also paying you while you figure it out.
[+] [-] mahmud|11 years ago|reply
[+] [-] majke|11 years ago|reply
* http://gee.cs.oswego.edu/dl/jmm/cookbook.html
[+] [-] starnixgod|11 years ago|reply
1. https://www.youtube.com/watch?v=1FX4zco0ziY
[+] [-] ivank|11 years ago|reply
[+] [-] virmundi|11 years ago|reply
[+] [-] aeonsky|11 years ago|reply
[+] [-] marcosscriven|11 years ago|reply
[+] [-] josephlord|11 years ago|reply
[+] [-] zmmmmm|11 years ago|reply
[+] [-] noelwelsh|11 years ago|reply
As you note you rarely need to concern yourself with the details of the memory model as most of us are users, not designers, of concurrency primitives. But you should you need to design a new primitive you can actually have some guarantees it will work in a cross-platform manner, which is more than you an say about any other platform I know of.
[+] [-] fiatmoney|11 years ago|reply
In most cases you can get away with coarser constructs (which are higher-performing anyway, eg task parallelism vs. trying to decompose an individual operation) and only dive into the language lawyering semantics when you, eg, really really need a lockfree concurrent linked list.
[+] [-] pcwalton|11 years ago|reply
I'd expand it beyond Java to shared-everything models in general. Any language with a shared-everything model is going to incur all this complexity. At least Java goes through this pain to ensure memory safety in the presence of unsynchronized accesses from multiple threads.
[+] [-] mushishi|11 years ago|reply