25 karma · joined January 20, 2015
Another reason was ease of use especially because Netty already supports message encoders and decoders for conversion between protobuf and bytebuf.
You could also use https://github.com/FasterXML/jackson-databind but that would require a reasonable amount of custom code for the encoder and decoders
By contention, I imply -- contention or conflicts on the same portions/pieces of structure.
If the data structure is subject to high concurrent access but in fairly disjoint regions of the data structure, we should try to implement fine grained locking scheme to increase the degree of parallelism and thus the scalability of data structure.
This is where CAS comes into picture. The article doesn't compare CAS to another locking primitive. Instead, CAS is just used as a mechanism to implement fine grained locking scheme where the methods operating on the data structure don't take global or coarse locks.
If the contention on the entire data structure is unreasonably high for some reason, then CAS based approaches or any flavors of it don't buy us much.
Goes without saying, spinlocks are not useful on uniprocessor machines or single core machines.
I tried to be as intuitive as possible in my post, but kind of missed to reason about this one.
Hope you liked the article !!