Avoid holding locks during lengthy computations or operations at risk of not completing quickly such as network or consoleI/O.
Even if you don't care about stale values,it is not safe to use shared mutable long and double variables in multithreaded programs unless they are declared volatile or guarded by a lock.
Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.