Skip to content

Trigger run_pending_tasks() in eviction listener [moka 0.12] #344

Discussion options

You must be logged in to vote

but then the eviction listener function was already processed, looking at a too high strong_count() value

Bug #345 will be one of the reasons for it.

But even after fixing it, you will still see too high string_count(). It is expected because:

  1. As you thought, some pending tasks may hold the value (Arc).
  2. Cache's internal concurrent hash table (cht) uses crossbeam-epoch, which is a epoch-based garbage collector.
    • Because of this, a value can live a bit longer after it was removed from cht.

From the README of crossbeam-epoch:

This crate provides epoch-based garbage collection for building concurrent data structures.

When a thread removes an object from a concurrent data structure, oth…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by peter-scholtens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants