openslide2vips uses multiple parallel osr reads
openslide2vips uses multiple parallel osr reads

open a separate openside_t for every read thread to try to get some
parallelism in decode

works, but no faster overall, since we don't ensure that each osr tile
is only fetched once --- threads need to synchronise and not overlap

we need:

- some way to get tile geometry from osr

- a threaded tilecache aligned to the osr tile boundaries

the tilecache needs to have locks and semaphores on every tile,
something like:

class tilecache:
  def generate(region):
    # lock all tiles we need, make a list of the ones that need
    # calculating
    work = []
    for tile in region:
      tile.lock()
      if tile.nodata():
        work.append(tile)
	tile.set(:in-progress)

    # calculate all empty tiles we need
    for tile in work:
      tile.calculate()
      tile.set(:data)

    # some tiles may be being made by another thread,
    # wait for them to be done
    for tile in region:
      if tile.in-progress:
        tile.wait()

    # should all have data now, paste to output and unlock
    for tile in region:
      tile.paste(output)
      tile.unlock()

    return output

jcupitt/libvips,wishabi/libvips,mcanthony/libvips,mcanthony/libvips,jcupitt/libvips,leiyangyou/libvips,lovell/libvips,lovell/libvips,leiyangyou/libvips,wishabi/libvips,lovell/libvips,leiyangyou/libvips,jcupitt/libvips,lovell/libvips,wishabi/libvips,jcupitt/libvips,mcanthony/libvips,leiyangyou/libvips,wishabi/libvips,mcanthony/libvips