Class ::acs::LockfreeCache

::acs::LockfreeCache[i] create ... \
           [ -prefix prefix ]

Lockfree caches are provided either as per-thread caches or per-request caches, sharing the property that accessing these values does not require locks. Typical applications of these caches are the per_request_cache and per_thread_cache.
See Also:
Object ::acs::per_request_cache
Object ::acs::per_thread_cache
Defined in packages/acs-tcl/tcl/acs-cache-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]

Methods (to be applied on instances)

  • eval (scripted, public)

     <instance of acs::LockfreeCache[i]> eval -key key  \
        [ -no_cache no_cache ] [ -no_empty ] \
        [ -from_cache_indicator from_cache_indicator ] cmd

    Use the "prefix" to determine whether the cache is per-thread or per-request.

    Switches:
    -key (required)
    key for caching, should start with package-key and a dot to avoid name clashes
    -no_cache (optional)
    list of returned values that should not be cached
    -no_empty (optional, defaults to "false")
    don't cache empty values. This flag is deprecated, one should use the no_cache flag instead.
    -from_cache_indicator (optional)
    variable name to indicate whether the returned value was from cache or not
    Parameters:
    cmd (required)
    command to be executed.
    Returns:
    return the last value set (don't use "return").

    Testcases:
    No testcase defined.
  • flush (scripted, public)

     <instance of acs::LockfreeCache[i]> flush [ -pattern pattern ]

    Flush a cache entry based on the pattern (which might be wild-card-free). Currently, the clusterwide flushing is omitted. We have the per-request cache (clusterwide operations do not make sense for this) and per-thread caching. The per-thread caching application have to be aware that flushing is happening only in one thread, so clusterwide operations will only start to make sense, when the all threads of a server would be cleaned.

    Switches:
    -pattern (optional, defaults to "*")

    Testcases:
    No testcase defined.
  • get (scripted, public)

     <instance of acs::LockfreeCache[i]> get -key key  var

    Get entry with the provided key from this cache if it exists. In most cases, the "eval" method should be used.

    Switches:
    -key (required)
    cache key
    Parameters:
    var (required)
    Returns:
    return boolean value indicating success.

    Testcases:
    No testcase defined.