Are "dirty readings" safe in Terracotta?

"Dirty reads", meaning reading the value of an object, even if it is locked by another stream, described on the Terracotta website, but I heard that they should not be used, even if you are not worried about the possibility of getting old data when the locked object is read dirty.

Does anyone have experience using dirty readings in Terracotta, and can they be used safely if you don't care about reading old values?

+3
source share
2 answers

A dirty reading is a dirty reading. Terracotta, being distributed / cluster, adds the ability to read even older values ​​of the general altered state that you are accessing without proper synchronization.

It should be noted that with the memory model in Java 5, you are not guaranteed to ever read the updated value unless you use the correct synchronization. Terracotta may decide to take this opportunity. In fact, any JVM can take advantage of this on vacation. Even if it can work on your machine, it can break down on other machines. It can break about minor JVM updates, and it can break for the same version of the same JVM on another processor.

, - JVM... , , - , .

, Terracottas wiki, , .

+3

Terracotta. , Christian Vest Hansen - , JVM , , Terracotta .

, .

+1

Source: https://habr.com/ru/post/1697583/


All Articles