From: SourceForge.net <no...@so...> - 2005-12-30 11:08:26
|
Feature Requests item #1119257, was opened at 2005-02-09 05:32 Message generated for change (Comment added) made by sdeasey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1119257&group_id=130646 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Tcl-API Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Zoran Vasiljevic (vasiljevic) Assigned to: Stephen Deasey (sdeasey) Summary: Cache API, add Tcl interface into core Initial Comment: Those commands are in the server itself: ns_cache_flush ns_cache_stats ns_cache_size ns_cache_names ns_cache_keys I would not touch them for the compatibility reasons. However, they are pretty limited (introspection/management). What is missing is type of functionality added by the nscache module which I believe should have be done long time ago already. Suggestion: Include nscache into the core Tcl commands. Stephen, you mentioned you've benn working on alternate cache implementation. Can we use this and add better Tcl interface? ---------------------------------------------------------------------- >Comment By: Stephen Deasey (sdeasey) Date: 2005-12-30 04:08 Message: Logged In: YES user_id=87254 2005-12-30 Stephen Deasey <sd...@us...> * include/ns.h: * nsd/nsd.h: * nsd/init.c: * nsd/proc.c: * nsd/cache.c: Global hash of cache names removed; access no longer available via Ns_CacheFind() or ns_cache_names. Caches have unique locking requirements and lifetimes which could be violated by e.g. running ns_cache_stats on a thread local cache as the thread is exiting. New Ns_CacheCreateEx() allows creating a cache which has both a size and a time limit. Caches with time limits are calculated differently. Previous behaviour was to periodically check the last access time of each cache entry and flush those which had expired. A busy cache could grow without bound. New behaviour is to check for expirey each time an entry is retrieved from the cache. All caches can (and should) be size limited. Timeouts may be specified per cache and per entry using new Ns_CacheSetValueExpires(). Ns_CacheFlush() now returns the number of entries flushed. New Ns_CacheStats() takes over from ns_cache_stats for non-Tcl caches. Stats are returned in Tcl "array get" format. Removed Ns_CacheMalloc(), Ns_CacheFree() and Ns_CacheName(). Move Tcl commands to tclcache.c. * nsd/Makefile: * nsd/tclcmds.c: * nsd/tclcache.c: * tests/ns_cache.test: Add new Tcl commands ns_cache_create, _eval, _append, _lappend, and _incr. (RFE# 1119257) Old commands ns_cache_names, _keys, _flush and _stats now only work on Tcl caches. ns_cache_size has been removed; the size is now reported along with other statistics. These commands now only work on Tcl caches. * tcl/cache.tcl: New ns_memoize and related commands which act just like ns_cache_eval but use the script as a key into the memoize cache. ---------------------------------------------------------------------- Comment By: Stephen Deasey (sdeasey) Date: 2005-12-23 12:01 Message: Logged In: YES user_id=87254 Here's a version of the Tcl caching commands merged into the core rather than as a stand alone module. It includes the extra commands such as _incr and _lappend, and also an implementation of ns_memoize. Tcl caches can be created at runtime. Individual entries can have a max lifetime. ---------------------------------------------------------------------- Comment By: Stephen Deasey (sdeasey) Date: 2005-10-21 04:04 Message: Logged In: YES user_id=87254 Attached a snapshot of development. This is obviously taking too long, so here it is. FIXME: Add explanation here... ---------------------------------------------------------------------- Comment By: Zoran Vasiljevic (vasiljevic) Date: 2005-02-09 10:25 Message: Logged In: YES user_id=95086 We can synthesize your changes and Stephens rewrite of the cache guts. I see no problem there. ---------------------------------------------------------------------- Comment By: Vlad Seryakov (seryakov) Date: 2005-02-09 10:20 Message: Logged In: YES user_id=184124 I added ns_cache incr command aslo some time ago, i think it is inthe CVS version of nscache. Also i used to play with core cache to add more prices size calculation incuding overhead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1119257&group_id=130646 |