|
|
|
|
|
by nullwasamistake
2587 days ago
|
|
Ironically volatile is just as bad in Java for different reasons. Frequently used for "lock free" synchronization, its usually actually worse than using locks because it can't be cached between cores. The variable is always loaded from main memory, which is usually much worse than holding a lock mutex in registers. |
|
That has many benefits, among them the ability to store its value in registers.