Synchronized Decorators to Replace Thread-Safe Classes

You know what thread safety is, right? If not, there is a simple example below. All classes must be thread-safe, right? Not really. Some of them have to be thread-safe? Wrong again. I think none of them have to be thread-safe, while all of them have to provide synchronized decorators.

[image error]Aladdin (1992) by Ron Clements and John Musker

Let's start with an example (it's mutable, by the way):

class Position { private int number = 0; @Override public void increment() { int before = this.numb...
 •  0 comments  •  flag
Share on Twitter
Published on January 16, 2017 16:00
No comments have been added yet.