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
From the documentation, it appears that SkipMap::compare_insert directly inserts the value without invoking the closure function if the key is absent. This behavior does not align with a true CAS (Compare-And-Swap) operation, as it bypasses the condition check against the old value, even when the key is not present.
Is it possible to do a CAS operation with the closure function called that includes cases where the key is absent?
The text was updated successfully, but these errors were encountered:
async fn compare_and_swap(
&self,
key: Key,
previous_value: Option<Value>,
new_value: Value,
) -> Result<(Option<Value>, bool), Error> {
match previous_value {
None =>
/// atomically associate new_value against the key iff key does not exist
Some(prev) =>
/// atomically associate new_value against the key iff a value exist for provided key and the existing value in the skipmap is `prev`
}
///( return///)
}
From the documentation, it appears that SkipMap::compare_insert directly inserts the value without invoking the closure function if the key is absent. This behavior does not align with a true CAS (Compare-And-Swap) operation, as it bypasses the condition check against the old value, even when the key is not present.
Is it possible to do a CAS operation with the closure function called that includes cases where the key is absent?
The text was updated successfully, but these errors were encountered: