Java is using volatile keyword memory efficient? -
if using 1 volatile variable, turn off cpu caching in other related non volatile variables well?
no, prevents variable beingness loaded cpu cache , modified there. more precisely, forces cpu flush cache after accessing volatile field. see here more complate details
java memory volatile memory-efficient
No comments:
Post a Comment