lpil / atomic-array

Atomic mutable int arrays for Gleam!
6 stars 0 forks source link

Atomic add with return of new value #1

Open Strandinator opened 4 months ago

Strandinator commented 4 months ago

I was rewatching parts of your livestream and realise that add with a return value was headache inducing.

Feel free to close this if it's offtopic. But i thought about rewriting the sequential ID generator in my project with atomics. Currently I am using an actor for that.

Looking at this module I could use compare_exchange and retry on error but i dont feel like that would be a good use of atomics.

Are you planning to revisit add returning the new value in the future?

lpil commented 4 months ago

I would like to have it but I will not be implementing it myself as I'm too busy, unfortunately.

Strandinator commented 4 months ago

That is understandable. I'll look into implementing that. Just no guarantees that I'll get it running ^^