Hacker News new | ask | show | jobs
by igtztorrero 236 days ago
In Golang there are sync.Mutex, sync.Atomic and Channels to create this fence and prevent data races. I prefer sync.Mutex.

Does anyone understand how Go handles the CPU cache?

1 comments

Yes. Locks will use a memory fence. More advanced programs will need fence without locking.