Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dash Cache has no get_with #168

Closed
gitmalong opened this issue Jul 17, 2022 · 2 comments
Closed

dash Cache has no get_with #168

gitmalong opened this issue Jul 17, 2022 · 2 comments
Labels
question Further information is requested

Comments

@gitmalong
Copy link

gitmalong commented Jul 17, 2022

or am I missing something?
Edit: Noticed there is get_or_insert_with

@tatsuya6502
Copy link
Member

Hi. You are right; dash::Cache has no get_with (or get_or_insert_with).

A bit of history; we added the experimental dash::Cache for the following reasons:

  1. A user wanted to ensure never to get an issue: Segmentation faults in moka-cht under heavy workloads on a many-core machine #34
    • The segmentation fault was occurring in our concurrent lock-free hash table implementation moka::cht.
    • moka::cht is used by sync and future caches.
  2. The same user wanted to reduce external crate dependencies. e.g. Remove crossbeam-epoch crate that is used by moka::cht.

We used dashmap::DashMap as an alternative concurrent hash table. However, implementing get_with method on it would require a non trivial amount of work, so we decided not to do it.

Now Moka v0.9.2 was just released with the fix for issue #34. So if you wanted to use dash::Cache just because to avoid the issue, you no longer have to use it. If so, please use sync::Cache or future::Cache instead.

@tatsuya6502 tatsuya6502 added the question Further information is requested label Jul 23, 2022
@tatsuya6502
Copy link
Member

I am closing this. Feel free to reopen if you find sync::Cache or future::Cache do not meet your requirements.

@tatsuya6502 tatsuya6502 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants