[KimDaBa] Multithreaded image loader?

Jesper K. Pedersen blackie at blackie.dk
Mon Jan 10 19:50:46 GMT 2005


On Monday 10 January 2005 14:24, Robert L Krawitz wrote:
| I notice a comment in the image manager that the image loader can't be
| made multithreaded because the JPEG loader isn't MT-safe.  Is this an
| issue in the JPEG library or somewhere else?  Particularly (but not
| exclusively) on an SMP/CMP or HT system, multithreading the loader
| might offer a significant performance improvement.
I removed the mutex from the code, and tries starting multiple image loaders, 
but I couldn't really tell any difference.

To try it out, cvs up to HEAD, and apply this patch
Let me know if you see any significant difference.

>>>>>>>>>>>>>>>>>>>>>>>>
diff -u -b -r1.27 imagemanager.cpp
--- imagemanager.cpp    10 Jan 2005 19:36:35 -0000      1.27
+++ imagemanager.cpp    10 Jan 2005 19:49:01 -0000
@@ -49,8 +49,10 @@
     _lock = new QMutex(); // necessary with new?

     // Only use 1 image loader thread as the JPEG loader is not thread safe
+    for ( int i = 0; i < 2; ++i ) {
     ImageLoader* imageLoader = new ImageLoader( _sleepers );
     imageLoader->start();
+    }
 }

 void ImageManager::load( const QString& fileName, ImageClient* client, int 
angle, int width, int height,
<<<<<<<<<<<<<<<<<<<<<<<



More information about the Kphotoalbum mailing list