What does @Volatile do

Alan Ramirez
1 min readSep 21, 2020

--

The @volatile annotation is part of the Kotlin programming language, and it is used for multithreading operations.

We use this annotation to denote that a variable must be read from this specific place in memory every time and therefore not cached anywhere, as some threading operations might do in the background, which if you are not aware of can lead to errors, and we don’t like those here.

--

--