> > 1) Start reload_db() in a background thread, resume scanning, and call > > back once the new engine is in place; then exchange the pointers > > from old to new engine and free the old one. > > FWIW, I have implemented this option, and it seems to work just fine. > Patch is pasted below. > > Do you see any problems with this approach?
Hi, I haven't looked closely, but how is the fact that each thread (which may currently be scanning a different file and may finish at some arbitrary time in the future) has a reference to the current engine object handled? It would seem that some sort of a reference count could be used to manage which thread actually frees the engine object which is being replaced... Maybe the settings object also needs a local reference in each of the scanning threads... - Mark Pizzolato _______________________________________________ http://lurker.clamav.net/list/clamav-devel.html Please submit your patches to our Bugzilla: http://bugs.clamav.net