so if i'm understanding correctly, atomicbools can be used in the same way mutex's can? but atomicbools are much more cost efficient in terms of runtime speed? why wouldn't i always use atomicbools over mutex
There are two main differences. 1) mutex are held until drop or unlock. Atomics are exclusive only at the call site of the load or the store 2) atomics only exist for primitive types. There is no atomic string or atomic my_struct
Your channel is a hidden gem I’m glad I’ve found. Really appreciate your content
so if i'm understanding correctly, atomicbools can be used in the same way mutex's can? but atomicbools are much more cost efficient in terms of runtime speed? why wouldn't i always use atomicbools over mutex
There are two main differences.
1) mutex are held until drop or unlock. Atomics are exclusive only at the call site of the load or the store
2) atomics only exist for primitive types. There is no atomic string or atomic my_struct
Thank you