From 4dc83ca64c9e5f0e87d08daf5b349e59ef97d5e1 Mon Sep 17 00:00:00 2001 From: Paul Cruz Date: Mon, 24 Jul 2017 15:14:58 -0700 Subject: [PATCH] compression thread should take measurements independently based on whether or not the create/write thread will actually bottleneck performance --- contrib/adaptive-compression/adapt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/adaptive-compression/adapt.c b/contrib/adaptive-compression/adapt.c index ec40130a6..ef0da42f8 100644 --- a/contrib/adaptive-compression/adapt.c +++ b/contrib/adaptive-compression/adapt.c @@ -412,14 +412,17 @@ static void* compressionThread(void* arg) pthread_mutex_unlock(&ctx->jobWrite_mutex.pMutex); - if (willWaitForCreate || willWaitForWrite) { - DEBUG(2, "compression will wait for create or write on job %u\n", currJob); - + if (willWaitForCreate) { + DEBUG(2, "compression will wait for create on job %u\n", currJob); pthread_mutex_lock(&ctx->createCompletion_mutex.pMutex); ctx->compressWaitCreateCompletion = ctx->createCompletion; DEBUG(2, "create completion %f\n", ctx->compressWaitCreateCompletion); pthread_mutex_unlock(&ctx->createCompletion_mutex.pMutex); + } + + if (willWaitForWrite) { + DEBUG(2, "compression will wait for write on job %u\n", currJob); pthread_mutex_lock(&ctx->writeCompletion_mutex.pMutex); ctx->compressWaitWriteCompletion = ctx->writeCompletion; DEBUG(2, "write completion %f\n", ctx->compressWaitWriteCompletion); -- 2.47.3