3 ms·
Two things: 1) Unless you've explicitly checked that Go's memory model prevents read/write moves to allow double-checked locking, don't do it. 2) The pattern
by Locke1689 11y ago
Two things:
1) Unless you've explicitly checked that Go's memory model prevents read/write moves to allow double-checked locking, don't do it.
2) The pattern is usually a CAS after the check.