Skip to content

Block the entire cache #6

Open
Open

Description

@SoftStoneDevelop

Sometimes you need to be able to lock the entire cache—rather than a single key—to prevent any changes to the cache.

Such a lock should also block ‘GetLock’ methods, just as if someone had already acquired a lock on the key.

In other words, the ‘LockCache’ method acquires a lock on the entire cache.
The reverse is also true: if someone has already acquired a lock on a specific key via ‘GetLock’, then ‘LockCache’ will only be able to lock the entire cache once the lock on that specific key is released.

This type of locking is useful for batch operations when you need to make many insertions or updates to the cache. Currently, you have to lock all keys plus a dummy “0” key (which essentially acts as a lock to prevent the creation of new entries).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions