Giter Site home page Giter Site logo

Comments (1)

tatsuya6502 avatar tatsuya6502 commented on June 12, 2024 3

Thanks for raising the request. Exposing these configurations should be easy, so I will just do it.

These thread pools are shared across all cache instances, so these limits will be cache-global configurations. Also, the thread pool library we use now does not support growing and shrinking the number of worker threads. So for now, they will be fixed numbers of worker threads, instead of limits (the maximum numbers of worker threads).

One limitation is that you cannot change those numbers while cache instances exist. So you will set them before creating any cache.

Just to clarify, this is how they work now (as of Moka v0.8.5):
(I will put them to somewhere in the doc)

  • There are two global thread pools:
    1. Housekeeping
      • Used by all concurrent caches (sync, future, experimental dash caches).
      • Used for:
        • Updating internal cache data structures such as LRU queue and LFU filter.
        • Removing expired entries.
        • etc.
    2. Invalidation
      • Used by sync and future caches with invalidation_closures configuration explicitly enabled.
      • Used for executing user-provided invalidation closures on cache entries.
  • A pool will be shared across all cache instance:
    • There should be zero or one housekeeping pool, and zero or one invalidation pool, no matter how many cache instances have been created.
  • A pool will be created when a cache using it is created.
    • I think many users do not set invalidation closures, so only the housekeeping thread pool will be created in many cases.
  • A pool will be dropped when all cache using it have been dropped.
  • A pool has a fixed number of worker threads:
    • The number is the same to available logical cores of the processor(s) of the machine.
    • I will make the number configurable.

from moka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.