|
|
|
Back to newsletter 188 contents
A Gem from this month's extracted tips (from Brian Goetz's talk): "There are three ways to thread-safely handle state: don't share or don't mutate or coordinate access". You've probably tried all three techniques at times, but without necessarily explicitly thinking that these were your alternatives.
What's nice about explicitly listing these three alternatives is that you can hold that in mind, and everytime you consider a concurrency implementation, you can think through these options (the order listed in the quote is also the order of increasing likelihood of generating issues, ie the first is easiest to maintain as least likely to cause bugs).
Of course there are corresponding overheads - both "don't share" and "don't mutate" techniques tend to increase copies of data, which incurs runtime and garbage collection costs that both impact latency. You gain high throughput for lower maintenance costs, but it's very hard to maintain high throughput together with low latency with those two techniques. If you need low latency, you need "coordinate access" and, more specifically, coordinate access using lock-free techniques.
Now almost on to our usual links to tools, articles, news, talks, but first a couple of goodies: for those of you interested in following the JCrete conference, #JCrete will be used to tag related items, including (live) periscope broadcasts; and finally LinkedIn's Zhenyun Zhuang's article on SSD-Friendly Applications, linked below, is an absolute must-read if you use SSDs, and I/O performance is important to you. And if you need the tips from that or any other of this month's articles and talks, as ever they are extracted into this month's tips page.
Java performance tuning related news.
Java performance tuning related tools.
Back to newsletter 188 contents