rust-decimal
rust-decimal copied to clipboard
Atomic Decimal
Hi!
Thanks for the crate, sorry not really an issue. Is there anyway I can do https://doc.rust-lang.org/std/sync/atomic/ with Rust Decimal?
I'm trying but I can't reach anything really working please guys it would be awesome if you give me a working example.
i'm concurrently doing additions (about 500,000 per second) from multiple threads
Great question! I'm currently traveling but will see if I can get something going for you over the next few days.
awesome thanks :) ps: i'm 100% sure it would help a ton of people
Highly waiting for this feature too!
Any news about it @paupino ? :)
Sorry for the delay - I still need to review this deeper to see what may be required. So far I've performed a quick review of atomic.rs and believe that we could potentially implement this as a feature mod to essentially wrap Decimal within an UnsafeCell and expose some basic features. That being said, I need to deeper dive into things like atomic_compare_exchange (as an example) and how that may work in this model.
Out of curiosity, I'm assuming AtomicPtr isn't suitable?
I don't think this is possible in stable without going through AtomicPtr, which can probably then be used directly. Given that an nod response in a fair while, closing this for now. It can be reopened if there's still interest.