I want to get a discrimitant atomically

⚓ Rust    📅 2025-11-12    👤 surdeus    👁️ 11      

surdeus

Warning

This post was published 67 days ago. The information described in this article may have changed.

I'm thinking about writing some utilities, like a lock-free OnceCell.
Logically, it shouldn't need any extra space if the type has a niche.
is it possible to get a discriminant atomically, using Ordering::Acquire?

ps. I don't need the get_or_init operation.

1 post - 1 participant

Read full topic

🏷️ Rust_feed