From 260e4da2729c7554843bef6b537dbf1b2636bb3c Mon Sep 17 00:00:00 2001 From: Ingo Date: Mon, 19 May 2014 13:42:56 +0200 Subject: [PATCH] Very bad response time on win64 builds using gcc 4.8 when queue is running, Issue 2384 --- rtengine/simpleprocess.cc | 5 +++++ rtgui/bqentryupdater.cc | 10 ++++++++-- rtgui/filebrowserentry.cc | 4 ++++ rtgui/thumbimageupdater.cc | 2 -- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 29f807df9..8cb8a7a7f 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -737,7 +737,12 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bo void startBatchProcessing (ProcessingJob* job, BatchProcessingListener* bpl, bool tunnelMetaData) { if (bpl) +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 8 && defined( WIN32 ) && defined(__x86_64__) + // See Issue 2384 "Very bad response time on win7/64 using gcc 4.8 when queue is running" + Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl, tunnelMetaData), 0, true, true, Glib::THREAD_PRIORITY_NORMAL); +#else Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl, tunnelMetaData), 0, true, true, Glib::THREAD_PRIORITY_LOW); +#endif } diff --git a/rtgui/bqentryupdater.cc b/rtgui/bqentryupdater.cc index 17e509315..8f7abb643 100644 --- a/rtgui/bqentryupdater.cc +++ b/rtgui/bqentryupdater.cc @@ -68,8 +68,14 @@ void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQ stopped = false; tostop = false; - #undef THREAD_PRIORITY_LOW - thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::processThread), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_LOW); +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 8 && defined( WIN32 ) && defined(__x86_64__) + #undef THREAD_PRIORITY_NORMAL + // See Issue 2384 comment #3 + thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::processThread), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_NORMAL); +#else + #undef THREAD_PRIORITY_LOW + thread = Glib::Thread::create(sigc::mem_fun(*this, &BatchQueueEntryUpdater::processThread), (unsigned long int)0, true, true, Glib::THREAD_PRIORITY_LOW); +#endif } } diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 772bba732..1bcb75648 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -204,7 +204,11 @@ void FileBrowserEntry::updateImage (rtengine::IImage8* img, double scale, rtengi param->img = img; param->scale = scale; param->cropParams = cropParams; +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 8 && defined( WIN32 ) && defined(__x86_64__) + g_idle_add_full (G_PRIORITY_DEFAULT, updateImageUI, param, NULL); +#else g_idle_add_full (G_PRIORITY_LOW, updateImageUI, param, NULL); +#endif } void FileBrowserEntry::_updateImage (rtengine::IImage8* img, double s, rtengine::procparams::CropParams cropParams) { diff --git a/rtgui/thumbimageupdater.cc b/rtgui/thumbimageupdater.cc index ed9858ba6..d8687e9ad 100644 --- a/rtgui/thumbimageupdater.cc +++ b/rtgui/thumbimageupdater.cc @@ -70,9 +70,7 @@ public: { int threadCount=1; #ifdef _OPENMP - #ifndef WIN32 // see Issue 2370 threadCount=omp_get_num_procs(); - #endif #endif threadPool_=new Glib::ThreadPool(threadCount,0);