From 755fa74c30f68efce5d2fd8eda61e98033e5358b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 6 Mar 2017 13:15:25 +0000 Subject: [PATCH] remove single-thread-first-tile thing new seq system makes it unnecessary --- TODO | 7 ------- libvips/iofuncs/threadpool.c | 18 ++++-------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/TODO b/TODO index 6a3f24b5..481b0734 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,3 @@ -- check initial cache sizing in vips_line_cache_build - - what about dynamic cache sizing? - - - - - vips_object_class_install_argument() should check for duplicate priorities, it's been behind a few nasty bugs diff --git a/libvips/iofuncs/threadpool.c b/libvips/iofuncs/threadpool.c index 68640805..76bc4090 100644 --- a/libvips/iofuncs/threadpool.c +++ b/libvips/iofuncs/threadpool.c @@ -15,6 +15,9 @@ * errors (thanks Tim) * 25/7/14 * - limit nthr on tiny images + * 6/3/17 + * - remove single-thread-first-request thing, new seq system makes it + * unnecessary */ /* @@ -548,12 +551,6 @@ typedef struct _VipsThreadpool { /* Set by Allocate (via an arg) to indicate normal end of computation. */ gboolean stop; - - /* Set by the first thread to hit allocate. The first work unit runs - * single-threaded to give loaders a change to get to the right spot - * in the input. - */ - gboolean done_first; } VipsThreadpool; /* Junk a thread. @@ -635,8 +632,7 @@ vips_thread_work_unit( VipsThread *thr ) return; } - if( pool->done_first ) - g_mutex_unlock( pool->allocate_lock ); + g_mutex_unlock( pool->allocate_lock ); /* Process a work unit. */ @@ -644,11 +640,6 @@ vips_thread_work_unit( VipsThread *thr ) thr->error = TRUE; pool->error = TRUE; } - - if( !pool->done_first ) { - pool->done_first = TRUE; - g_mutex_unlock( pool->allocate_lock ); - } } /* What runs as a thread ... loop, waiting to be told to do stuff. @@ -781,7 +772,6 @@ vips_threadpool_new( VipsImage *im ) vips_semaphore_init( &pool->tick, 0, "tick" ); pool->error = FALSE; pool->stop = FALSE; - pool->done_first = FALSE; /* If this is a tiny image, we won't need all nthr threads. Guess how * many tiles we might need to cover the image and use that to limit