On 6/19/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote:
Stephen,

I understand you have the "right" vision how to do things but after long
period of time just removing Tcl API functions (cache set/get) is not
very polite.
It breaks a lot of Tcl code and i am not sure why do you think they are
racey and i need to emulate them in Tcl instead of C.

Very frustrating.


We talked about this before.  If I remember correctly, you didn't
disagree with me that the commands were racy, you said you code base
was large and you didn't have time to figure out what you really
needed.

More and more unnecessary code is being added.  Things are getting out
of control.  However, you'll notice that I did not just remove
everything.  With the new -force switch to ns_cache_eval, _set, _get,
and _info can be trivially emulated in a couple of lines of Tcl, if
you want that kind of racy behaviour.

Everything is of course still available via the C api, and I'd
recommend taking a look at what your real requirements are and
building accordingly.  If it can be generalised, we can get it into
the core.


Sorry this is hurried.  I don't have 'net access.  I'll be travelling
for the next couple of weeks.


Stephen Deasey wrote:
> Update of /cvsroot/naviserver/naviserver
> In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27993
>
> Modified Files:
>       ChangeLog
> Log Message:
>         * nsd/fastpath.c:
>         * nsd/adpeval.c: Use Ns_CacheDeleteEntry instead of
>         Ns_CacheFlushEntry to prevent genuine flush stats being inflated.
>
>         * tcl/cache.tcl:
>         * nsd/nsconf.c:
>         * nsd/dns.c: Update to new API.
>
>         * nsd/nsd.h:
>         * nsd/server.c: Remove tcl cache timeout param in anticipation of new
>         limits API.
>
>         * nsd/tclcmds.c: Remove ns_cache _get _set _exists _info
>         commands. The first three are racey and can be emulated with _eval
>         and the new -force switch.  The new -contents switch to the _stats
>         command replaces _info, discouraging racey check-and-set usage.
>
>         * nsd/tcltime.c:
>         * nsd/tclobjv.c: New Ns_ObjvTime parse callback for the Ns_Time
>         type. Handy for passing absolute time deadlines to routines which
>         timeout.
>
>         * include/ns.h:
>         * nsd/cache.c: New Ns_CacheResetStats routine.
>
>         Ns_CacheGetConfig removed -- caches are immutable; the current
>         settings can be looked up in the config file.
>
>         Directly expire entries from within all routines which return one,
>         but but only if the value is not null, indicating no concurrent
>         update is in progress.
>
>         Use Ns_CacheDeleteEntry to remove an entry from the cache without
>         updating the stats. Flush stats should reflect explicit flushes
>         only.
>
>         Log stats when a cache is destroyed.
>
>         * nsd/tclcache.c: ns_cache_create now takes a -maxentry option
>         which is the maximum size of an entry allowed in the cache. This
>         prevents one large entry completely emptying an otherwise usefully
>         full cache.
>
>         The ns_cache_create -timeout switch has been removed in
>         anticipation of a general purpose limits scheme.
>
>         The -timeout option is now expected to be an absolute time in the
>         future, not an offset from the current time. This is awkward to
>         use manually, but should not be needed with the above mentioned
>         limits scheme. The -ttl option has been renames -expires and is
>         also an absolute time.
>
>         ns_cache_eval now takes a -force switch which will unconditioanly
>         replace any exiting entry, whether it has expired or not. Replaces
>         _set.
>
>         ns_cache_stats -content dumps the size and expirey for each
>         entry in the cache. Adding the -reset switch to either mode resets
>         the stats to zero.
>
>         * tests/ns_cache.test: Try to exercise the underlying Ns_CacheFind
>         harder with some more flush tests.
>
>
>
> Index: ChangeLog
> ===================================================================
> RCS file: /cvsroot/naviserver/naviserver/ChangeLog,v
> retrieving revision 1.405
> retrieving revision 1.406
> diff -C2 -d -r1.405 -r1.406
> *** ChangeLog 19 Jun 2006 19:05:47 -0000      1.405
> --- ChangeLog 19 Jun 2006 21:16:38 -0000      1.406
> ***************
> *** 1,2 ****
> --- 1,71 ----
> + 2006-06-19  Stephen Deasey  <[EMAIL PROTECTED]>
> +
> +     * nsd/fastpath.c:
> +     * nsd/adpeval.c: Use Ns_CacheDeleteEntry instead of
> +     Ns_CacheFlushEntry to prevent genuine flush stats being inflated.
> +
> +     * tcl/cache.tcl:
> +     * nsd/nsconf.c:
> +     * nsd/dns.c: Update to new API.
> +
> +     * nsd/nsd.h:
> +     * nsd/server.c: Remove tcl cache timeout param in anticipation of new
> +     limits API.
> +
> +     * nsd/tclcmds.c: Remove ns_cache _get _set _exists _info
> +     commands. The first three are racey and can be emulated with _eval
> +     and the new -force switch.  The new -contents switch to the _stats
> +     command replaces _info, discouraging racey check-and-set usage.
> +
> +     * nsd/tcltime.c:
> +     * nsd/tclobjv.c: New Ns_ObjvTime parse callback for the Ns_Time
> +     type. Handy for passing absolute time deadlines to routines which
> +     timeout.
> +
> +     * include/ns.h:
> +     * nsd/cache.c: New Ns_CacheResetStats routine.
> +
> +     Ns_CacheGetConfig removed -- caches are immutable; the current
> +     settings can be looked up in the config file.
> +
> +     Directly expire entries from within all routines which return one,
> +     but but only if the value is not null, indicating no concurrent
> +     update is in progress.
> +
> +     Use Ns_CacheDeleteEntry to remove an entry from the cache without
> +     updating the stats. Flush stats should reflect explicit flushes
> +     only.
> +
> +     Log stats when a cache is destroyed.
> +
> +     * nsd/tclcache.c: ns_cache_create now takes a -maxentry option
> +     which is the maximum size of an entry allowed in the cache. This
> +     prevents one large entry completely emptying an otherwise usefully
> +     full cache.
> +
> +     The ns_cache_create -timeout switch has been removed in
> +     anticipation of a general purpose limits scheme.
> +
> +     The -timeout option is now expected to be an absolute time in the
> +     future, not an offset from the current time. This is awkward to
> +     use manually, but should not be needed with the above mentioned
> +     limits scheme. The -ttl option has been renames -expires and is
> +     also an absolute time.
> +
> +     ns_cache_eval now takes a -force switch which will unconditioanly
> +     replace any exiting entry, whether it has expired or not. Replaces
> +     _set.
> +
> +     ns_cache_stats -content dumps the size and expirey for each
> +     entry in the cache. Adding the -reset switch to either mode resets
> +     the stats to zero.
> +
> +
> +
> +
> +
> +     * tests/ns_cache.test: Try to exercise the underlying Ns_CacheFind
> +     harder with some more flush tests.
> +
>   2006-05-19  Vlad Seryakov  <[EMAIL PROTECTED]>
>
>
>
>
> _______________________________________________
> naviserver-commits mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/naviserver-commits
>

--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/



_______________________________________________
naviserver-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/naviserver-commits


Reply via email to