To build libvcbcache.a, just run make.  It will trigger the creation of a slightly modified libfdr.a using makefile_fdr.  It's modified in that we only need Dllists and JRBs (and Jvals, of course) and some C++ to C interfacing needed to be done.

This version is preemptive, so any prefetching is done in a separate thread.  A mutex is used to protect the cache from simultaneous access.  The specifically requested data will always be granted processing first, even when there is a list of items to prefetch.

One thing to keep in mind is the list of items to prefetch can grow to contain obsolete items if the user moves very fast through data.  There are three ways to curtail this:

  1) Don't do anything, but have a cache will a small capacity.  Items that
     were thrown in the prefetch list a long time ago will be examined but
     will have a priority low enough that they will not be pulled into the 
     cache.  Little computation will be wasted.

  2) Don't prefetch too much neighboring data.  Then the list won't grow too
     fast.

  3) Specify a restriction on the number of prefetched items that may be out at
     any given time.  This can be set using the last argument to vcbCacheMake.

An example of the library at work is found in t_cached_mcube_main.cpp.  It's a test main that fits in the VCB like all the other test mains.  It grabs a block of the brain volume, and you can move the subsection of the volume along the x, y, and z axes with the x, y, z, X, Y, and Z keys.  Blocks are cached so if they are revisited so they be pulled automatically from the cache.  The marching cube algorithm will not have to be run on the block again.
