When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations on it should not be reordered with other memory operations. Volatile variables are not cached in registers or in caches where they are hidden from other processors, so a read of a volatile variable always returns the most recent write by any thread.

Auteur: Brian Goetz

When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations on it should not be reordered with other memory operations. Volatile variables are not cached in registers or in caches where they are hidden from other processors, so a read of a volatile variable always returns the most recent write by any thread. - Brian Goetz


©gutesprueche.com

Data privacy

Imprint
Contact
Wir benutzen Cookies

Diese Website verwendet Cookies, um Ihnen die bestmögliche Funktionalität bieten zu können.

OK Ich lehne Cookies ab