JUCE threading. I need a good advice

Hello everyone!

I develop a simple image viewer application.

The left side of it is a directory tree and the right side is a thumbnail viewer.

I want the application to be extremely responsive. I want to click a directory and thumbnails must immediately start loading, building and updating themselves in background. Each thumbnail is supposed to be a component. Moreover, If I click another directory while thumbnails are loading, old ones must disappear at once and new ones must start building and updating immediately.

 

So, the question is how to do it the right way, the JUCE way? Julian?

 

-------------------------------------

P.S. I wonder, Is it possible to swap two instances of OwnedArrays ​safely using C++ rvalue feature (e.g. std::move)?

Thanks Hugh )

But anyway, why not to use a separate component for a thumbnail?

I think, using a component for a thumbnail is an easy way to track mouse events etc...