Using Steves threadsafe DCRAW to roughly double thumbnail generation speed on multicore CPUs. Now there are two update worker threads. Easy to remove if someone provides code for a more efficient distribution mechanism.

This commit is contained in:
Oliver Duis
2010-10-28 21:47:52 +02:00
parent c8cd634dbc
commit 37ea6a7380
2 changed files with 49 additions and 1 deletions

View File

@@ -970,3 +970,25 @@ bool FileCatalog::handleShortcutKey (GdkEventKey* event) {
return false;
}
void PreviewMultiLoader::setPreviewLoaderListener (PreviewLoaderListener* p) {
loadA.setPreviewLoaderListener(p); loadB.setPreviewLoaderListener(p);
}
// Simple round robin
void PreviewMultiLoader::add(DirEntry de) {
if (next==0) {
loadA.add(de);
next=1;
} else {
loadB.add(de);
next=0;
}
}
void PreviewMultiLoader::start () { loadA.start(); loadB.start(); }
void PreviewMultiLoader::process () { loadA.process (); loadB.process(); }
void PreviewMultiLoader::remove (Glib::ustring fname) { loadA.remove(fname); loadB.remove(fname); }
void PreviewMultiLoader::end () { loadA.end(); loadB.end(); }
bool PreviewMultiLoader::runs () { return loadA.runs() || loadB.runs(); }
void PreviewMultiLoader::terminate () { loadA.terminate(); loadB.terminate(); }
void PreviewMultiLoader::stop () { loadA.stop(); loadB.stop(); }