cuflow/cacheconf.h: Cache Configuration
[[experimental]]

Data Structures

struct  cuflow_cacheconf

Functions

void cuflow_cacheconf_init (cuflow_cacheconf_t conf, cu_bool_t(*manager)(cuflow_cacheconf_t conf, struct timespec *t_now))
cuflow_cacheconf_t cuflow_default_cacheconf (void)

Detailed Description

This is used by cuflow/cached.h and cuflow/cache.h.


Function Documentation

void cuflow_cacheconf_init ( cuflow_cacheconf_t  conf,
cu_bool_t(*)(cuflow_cacheconf_t conf, struct timespec *t_now)  manager 
)

Construct a cache configuration. manager is a function which will be called once during this construction, then occationally afterwards. If the parameters were not set prior to this call, then manager must set them on it's first invokation. It may also update other parameters contituously to implement heuristics for controlling memory consumption.

manager should normally always return true, but if there is need to shut down the cache configuration, false may be returned. After that, cache clock will stop and cached objects will no longer be freed. Therefore, the client should make sure to destruct associated caches with cuflow_cache_deinit in conjuction with a false return from manager.

cuflow_cacheconf_t cuflow_default_cacheconf ( void   ) 

A predefined cache configuration. Note that calling this the first time will spawn one worker thread if there are none running, see cuflow/workers.h: Auxiliary Worker Threads.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.