Skip to content

Potential deadlock - insert and evict acquire the same accessor #5

@jy5275

Description

@jy5275

In insert method, under hight concurrent cases, it possible for a thread to evict the node that was just inserted by the same call.
So the thread at A tries to acquire the accessor that it already taken at B:
A: https://github.com/tstarling/thread-safe-lru/blob/master/thread-safe-lru/lru-cache.h#L387
B: https://github.com/tstarling/thread-safe-lru/blob/master/thread-safe-lru/lru-cache.h#L281
which cause deadlock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions