sync/atomic is lowkey underused ngl. if ur just incrementing a counter or swapping a config value atomic.AddInt64 or atomic.Value is way cleaner than spinning up a mutex for it
When I first looked at Go's atomics, I was very surprised that the language that supposedly makes concurrency easy only provides sequentially consistent atomics. Even on x64 that leaves a lot of performance on the table for no reason.
----e----
I just remembered that Go authors don't trust Go developers, that might explain it.
Ha_Deal_5079@reddit
sync/atomic is lowkey underused ngl. if ur just incrementing a counter or swapping a config value atomic.AddInt64 or atomic.Value is way cleaner than spinning up a mutex for it
l3g4tr0n@reddit
lowkey is lowkey overused... just my lowkey opinion
rotato@reddit
Lowkeymaxxing
calling_kyle@reddit
commonly used by asyncbros
simpleauthority@reddit
Lowkenuinely goated opinion.
Sorry
BlueGoliath@reddit
Go got atomic operations before enums?!?!?!?
SwedishFindecanor@reddit
Go has enums. What it doesn't have is tagged unions.
pjmlp@reddit
They will never backtrack from the const/iota dance for enums, unfortunely.
Dragdu@reddit
When I first looked at Go's atomics, I was very surprised that the language that supposedly makes concurrency easy only provides sequentially consistent atomics. Even on x64 that leaves a lot of performance on the table for no reason.
----e----
I just remembered that Go authors don't trust Go developers, that might explain it.
BenchEmbarrassed7316@reddit
You don't understand the philosophy of go. Adding this feature will significantly complicate the language and slow down the compiler.
pjmlp@reddit
Turbo Pascal (on MS-DOS!), Delphi, D, and many others are Go like fast, while having plenty of goodies.
BenchEmbarrassed7316@reddit
Oh, I forgot to add '/s' to my comment.
BenchEmbarrassed7316@reddit
lol no ordering/barrier