Skip to content
Snippets Groups Projects
Commit b072b773 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

Use imglib2-cache-beta-12 and fix compile errors.

In particular, BlockingFetchQueues now needs to know the number of
consumers (fetcher-threads). To realize cache invalidate, it must be
possible to pause the fetcher-threads, which means driving the queue into
a state where all consumers are held in take(). To do that,
BlockingFetchQueues.pause() blocks until all (of the pre-defined number
of) consumer threads have arrived in take().
parent b23a402d
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,8 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>
<imglib2-cache.version>1.0.0-beta-12</imglib2-cache.version>
</properties>
<repositories>
......
......@@ -125,7 +125,7 @@ public class VolatileGlobalCellCache implements CacheControl
*/
public VolatileGlobalCellCache( final int maxNumLevels, final int numFetcherThreads )
{
queue = new BlockingFetchQueues<>( maxNumLevels );
queue = new BlockingFetchQueues<>( maxNumLevels, numFetcherThreads );
new FetcherThreads( queue, numFetcherThreads );
backingCache = new SoftRefLoaderCache<>();
}
......
......@@ -212,8 +212,9 @@ public class Hdf5ImageLoader implements ViewerImgLoader, MultiResolutionImgLoade
shortLoader = new Hdf5VolatileShortArrayLoader( hdf5Access );
final BlockingFetchQueues< Callable< ? > > queue = new BlockingFetchQueues<>( maxNumLevels );
fetchers = new FetcherThreads( queue, 1 );
final int numFetcherThreads = 1;
final BlockingFetchQueues< Callable< ? > > queue = new BlockingFetchQueues<>( maxNumLevels, numFetcherThreads );
fetchers = new FetcherThreads( queue, numFetcherThreads );
cache = new VolatileGlobalCellCache( queue );
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment