dynamic providers and garbage collection
Jim Meyering
jim at meyering.net
Fri Jan 14 21:49:25 UTC 2011
My dynamic providers branch is in decent shape,
so I've pushed it to the new dyn-providers-gc branch.
http://repo.or.cz/w/iwhd.git/shortlog/refs/heads/dyn-provider-gc
Here's the shortlog summary:
fix an unchecked strdup
allow dynamic addition/deletion of providers
don't use xstrndup via base_name
add provider ref-counting; FIXME: partial impl. (i.e., no incr)
reject an attempt to add a provider with "name" parameter
use new function, get_main_provider, rather than global "main_prov"
tests: clean up provider-deletion test
get primary provider name via http://host:$port/_providers/_primary
new interface: curl -X PUT http://_providers/PROVIDER/_set_primary
rename s/_set_primary/_primary/: more RESTful
maint: rename file-scoped global s/main_prov/g_main_prov/, and...
use garbage collection
garbage-collection fix-up
remove functions and struct members that are no longer needed
tests: add dynamic-provider test
guard provider-addition with a mutex; tighten provider test
do not allow "updating" a provider in place -- now, you must remove and then re-add
remove more tests of in-place provider changing
begin converting hash tables from glib to gnulib
convert remaining g_hash_table_lookup functions to kv_hash_lookup
convert all remaining uses of g_hash_* functions
insinuate GC into gnulib's hash-related code
tell GC about the thread spawned by MHD_start_daemon
t/provider: warn-then-sleep on failure -- eases debugging
avoid a leak via ms->post = MHD_create_post_processor(...
handle hash_initialize and MHD_create_post_processor failure
avoid unnecessary MHD_lookup_connection_value calls
rewrite provider-listing code so we can protect it with a mutex:
also mutex-protect the provider-iterator used in listing
Some of the earlier patches have been largely subsumed
in the later ones, once garbage collection was added.
In a sense, that means it'd be nice to merge them with
the later patches that do the subsuming, but that would
take more than a little time, so I'm not inclined.
I've already spent quite a bit of time trying to make
this series presentable.
I have 3 tasks on my short-term TODO list:
- mutex-protect the two provider iteration loops in replica.c
- plug a small leak in meta.cpp
- fix meta.cpp so it doesn't come up with a reference to malloc
(as opposed to GC_malloc). I think it does this via some mongodb
method that uses a json-related inline extern-C function.
Jim
More information about the iwhd-devel
mailing list