Settings

Theme

Atomic Operations Composition in Go

antonz.org

15 points by boyter a year ago · 5 comments

Reader

chen_dev a year ago

> People sometimes think that the composition of atomics also magically becomes an atomic operation. But this is not the case.

> var counter atomic.Int32

> func increment() {

> if counter.Load()%2 == 0 {

> sleep(10)

> counter.Add(1)

> } else {

> sleep(10)

> counter.Add(2)

> }

> }

Is "atomic operations composition" a real term? Or it's something like "monolithic microservice"? What does that even mean?

  • BobbyJo a year ago

    > Is "atomic operations composition" a real term? Or it's something like "monolithic microservice"? What does that even mean?

    Its a real term in the sense that it's a grammatically correct way of describing multiple atomic operations being composed together...

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection