On 15.10.2007, at 23:27, Andrew Piskorski wrote: > > Making nsv usable from C code is very useful, and not all that hard. > I've done it in the past (for AOLserver 3.x and 4.0.x). So, just how > are the use cases for dynamic ns_config different from those for nsv?
Good question. Tt happens that we already use the ns_section/ns_param all over the code (c and tcl). furthermore we need to be able to tune server params during runtime as well. All this is not what nsv's are. > > Since the existig ns_config is totally static, it's safe to take the > pointer returned by Ns_ConfigGetValue() and just assume it never > changes and is always valid process-wide. But of course that can't > work when calling Nsv from C code. What does your dynamic ns_config > code do for that case? It gets the value from it's per-thread cache. But, the source-code is pretty simple and documented so you should be able to get the idea by skipping thru the code (takes about 10-15 minutes). It tries to avoid lock contention by greedily caching all conf params in all threads that access them. OTOH, writers have a "tough" job of updating all those private thread caches everytime some config parameter is changed. Cheers Zoran ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel