Branch: refs/heads/master
Home: https://github.com/Starlink/starlink
Commit: 5e41116791ac61e17da08ab75f447fc03afadf69
https://github.com/Starlink/starlink/commit/5e41116791ac61e17da08ab75f447fc03afadf69
Author: David Berry <[log in to unmask]>
Date: 2013-09-24 (Tue, 24 Sep 2013)
Changed paths:
M applications/smurf/libsmf/Makefile.am
M applications/smurf/libsmf/smf.h.source
M applications/smurf/libsmf/smf_calc_smoothedwvm.c
M applications/smurf/libsmf/smf_calc_wvm.c
A applications/smurf/libsmf/smf_calc_wvm_clear.c
M applications/smurf/libsmf/smf_fix_metadata_scuba2.c
M applications/smurf/smurf_mon.c
Log Message:
-----------
smurf: change smf_calc_wvm to use per-thread cache
smf_calc_wvm is called as part of the metadata fix-up process when a file
is opened. This happens many times, including when downsampling. In the
case of smf_downsample, each file is opened with a worker thread. Before
this partch, smf_calc_wvm used a single cache which was usually created
in the main thread. This caused an error when opening files within
smf_downsample, as the cache was not locked by the current thread. This
error was subsequently annulled and so the fact that the cache was not
being used went unnoticed, except for a dramatic slow-down in makemap.
To avoid all these sorts of problems, I've changed smf_calc_wvm so that
each thread uses its own thread-specific cache.
|