You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be cool to have a way to simplify storing mycelium-bitfield bitfield types in atomics.
i'm not sure whether the best design is something like this, where the T-typed bitfield types are treated as "snapshots" that can be loaded/stored in the atomic:
// `T` is a `mycelium-bitfield` generated typepubstructAtomicBitfield<T>{// ...}impl<T>AtomicBitfield<T>{pubfnload(&self,ordering:Ordering) -> T{// ...}pubfncompare_exchange(&self,curr:T,next:T,success:Ordering,failure:Ordering) -> Result<T,T>{// ...}// and so on...}
it would be cool to have a way to simplify storing
mycelium-bitfield
bitfield types in atomics.i'm not sure whether the best design is something like this, where the
T
-typed bitfield types are treated as "snapshots" that can be loaded/stored in the atomic:or, something like this:
and having it generate versions of the
get
andset
methods that take&self
when the bits type is an atomic.I think the first one is actually better, as it allows more complicated CAS patterns that toggle multiple bits in one atomic op...
The text was updated successfully, but these errors were encountered: