Lines Matching full:jobs

597     /* Now it is the next jobs turn */  in ZSTDMT_serialState_update()
802 BYTE* buffer; /* The round input buffer. All jobs get references
836 ZSTDMT_jobDescription* jobs; member
900 ZSTDMT_freeJobsTable(mtctx->jobs, mtctx->jobIDMask+1, mtctx->cMem); in ZSTDMT_expandJobsTable()
902 mtctx->jobs = ZSTDMT_createJobsTable(&nbJobs, mtctx->cMem); in ZSTDMT_expandJobsTable()
903 if (mtctx->jobs==NULL) return ERROR(memory_allocation); in ZSTDMT_expandJobsTable()
944 mtctx->jobs = ZSTDMT_createJobsTable(&nbJobs, cMem); in ZSTDMT_createCCtx_advanced_internal()
952 …if (!mtctx->factory | !mtctx->jobs | !mtctx->bufPool | !mtctx->cctxPool | !mtctx->seqPool | initEr… in ZSTDMT_createCCtx_advanced_internal()
981 ZSTD_pthread_mutex_t const mutex = mtctx->jobs[jobID].job_mutex; in ZSTDMT_releaseAllJobResources()
982 ZSTD_pthread_cond_t const cond = mtctx->jobs[jobID].job_cond; in ZSTDMT_releaseAllJobResources()
984 …DEBUGLOG(4, "job%02u: release dst address %08X", jobID, (U32)(size_t)mtctx->jobs[jobID].dstBuff.st… in ZSTDMT_releaseAllJobResources()
985 ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[jobID].dstBuff); in ZSTDMT_releaseAllJobResources()
988 ZSTD_memset(&mtctx->jobs[jobID], 0, sizeof(mtctx->jobs[jobID])); in ZSTDMT_releaseAllJobResources()
989 mtctx->jobs[jobID].job_mutex = mutex; in ZSTDMT_releaseAllJobResources()
990 mtctx->jobs[jobID].job_cond = cond; in ZSTDMT_releaseAllJobResources()
1002 ZSTD_PTHREAD_MUTEX_LOCK(&mtctx->jobs[jobID].job_mutex); in ZSTDMT_waitForAllJobsCompleted()
1003 while (mtctx->jobs[jobID].consumed < mtctx->jobs[jobID].src.size) { in ZSTDMT_waitForAllJobsCompleted()
1005 ZSTD_pthread_cond_wait(&mtctx->jobs[jobID].job_cond, &mtctx->jobs[jobID].job_mutex); in ZSTDMT_waitForAllJobsCompleted()
1007 ZSTD_pthread_mutex_unlock(&mtctx->jobs[jobID].job_mutex); in ZSTDMT_waitForAllJobsCompleted()
1018 ZSTDMT_freeJobsTable(mtctx->jobs, mtctx->jobIDMask+1, mtctx->cMem); in ZSTDMT_freeCCtx()
1092 DEBUGLOG(6, "ZSTDMT_getFrameProgression: jobs: from %u to <%u (jobReady:%u)", in ZSTDMT_getFrameProgression()
1096 ZSTDMT_jobDescription* jobPtr = &mtctx->jobs[wJobID]; in ZSTDMT_getFrameProgression()
1108 ZSTD_pthread_mutex_unlock(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_getFrameProgression()
1124 ZSTDMT_jobDescription* const jobPtr = &mtctx->jobs[wJobID]; in ZSTDMT_toFlushNow()
1141 ZSTD_pthread_mutex_unlock(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_toFlushNow()
1272 /* We refuse to create jobs < RSYNC_MIN_BLOCK_SIZE bytes, so make sure our in ZSTDMT_initCStream_internal()
1366 mtctx->jobs[jobID].src.start = src; in ZSTDMT_createCompressionJob()
1367 mtctx->jobs[jobID].src.size = srcSize; in ZSTDMT_createCompressionJob()
1369 mtctx->jobs[jobID].prefix = mtctx->inBuff.prefix; in ZSTDMT_createCompressionJob()
1370 mtctx->jobs[jobID].consumed = 0; in ZSTDMT_createCompressionJob()
1371 mtctx->jobs[jobID].cSize = 0; in ZSTDMT_createCompressionJob()
1372 mtctx->jobs[jobID].params = mtctx->params; in ZSTDMT_createCompressionJob()
1373 mtctx->jobs[jobID].cdict = mtctx->nextJobID==0 ? mtctx->cdict : NULL; in ZSTDMT_createCompressionJob()
1374 mtctx->jobs[jobID].fullFrameSize = mtctx->frameContentSize; in ZSTDMT_createCompressionJob()
1375 mtctx->jobs[jobID].dstBuff = g_nullBuffer; in ZSTDMT_createCompressionJob()
1376 mtctx->jobs[jobID].cctxPool = mtctx->cctxPool; in ZSTDMT_createCompressionJob()
1377 mtctx->jobs[jobID].bufPool = mtctx->bufPool; in ZSTDMT_createCompressionJob()
1378 mtctx->jobs[jobID].seqPool = mtctx->seqPool; in ZSTDMT_createCompressionJob()
1379 mtctx->jobs[jobID].serial = &mtctx->serial; in ZSTDMT_createCompressionJob()
1380 mtctx->jobs[jobID].jobID = mtctx->nextJobID; in ZSTDMT_createCompressionJob()
1381 mtctx->jobs[jobID].firstJob = (mtctx->nextJobID==0); in ZSTDMT_createCompressionJob()
1382 mtctx->jobs[jobID].lastJob = endFrame; in ZSTDMT_createCompressionJob()
1383 …mtctx->jobs[jobID].frameChecksumNeeded = mtctx->params.fParams.checksumFlag && endFrame && (mtctx-… in ZSTDMT_createCompressionJob()
1384 mtctx->jobs[jobID].dstFlushed = 0; in ZSTDMT_createCompressionJob()
1407 ZSTDMT_writeLastEmptyBlock(mtctx->jobs + jobID); in ZSTDMT_createCompressionJob()
1415 (U32)mtctx->jobs[jobID].src.size, in ZSTDMT_createCompressionJob()
1416 mtctx->jobs[jobID].lastJob, in ZSTDMT_createCompressionJob()
1419 if (POOL_tryAdd(mtctx->factory, ZSTDMT_compressionJob, &mtctx->jobs[jobID])) { in ZSTDMT_createCompressionJob()
1443 ZSTD_PTHREAD_MUTEX_LOCK(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_flushProduced()
1446 assert(mtctx->jobs[wJobID].dstFlushed <= mtctx->jobs[wJobID].cSize); in ZSTDMT_flushProduced()
1447 … while (mtctx->jobs[wJobID].dstFlushed == mtctx->jobs[wJobID].cSize) { /* nothing to flush */ in ZSTDMT_flushProduced()
1448 if (mtctx->jobs[wJobID].consumed == mtctx->jobs[wJobID].src.size) { in ZSTDMT_flushProduced()
1450 … mtctx->doneJobID, (U32)mtctx->jobs[wJobID].consumed, (U32)mtctx->jobs[wJobID].src.size); in ZSTDMT_flushProduced()
1454 mtctx->doneJobID, (U32)mtctx->jobs[wJobID].dstFlushed); in ZSTDMT_flushProduced()
1455 …ZSTD_pthread_cond_wait(&mtctx->jobs[wJobID].job_cond, &mtctx->jobs[wJobID].job_mutex); /* block w… in ZSTDMT_flushProduced()
1459 { size_t cSize = mtctx->jobs[wJobID].cSize; /* shared */ in ZSTDMT_flushProduced()
1460 size_t const srcConsumed = mtctx->jobs[wJobID].consumed; /* shared */ in ZSTDMT_flushProduced()
1461 …size_t const srcSize = mtctx->jobs[wJobID].src.size; /* read-only, could be done after mutex… in ZSTDMT_flushProduced()
1462 ZSTD_pthread_mutex_unlock(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_flushProduced()
1473 && mtctx->jobs[wJobID].frameChecksumNeeded ) { in ZSTDMT_flushProduced()
1476 … MEM_writeLE32((char*)mtctx->jobs[wJobID].dstBuff.start + mtctx->jobs[wJobID].cSize, checksum); in ZSTDMT_flushProduced()
1478 … mtctx->jobs[wJobID].cSize += 4; /* can write this shared value, as worker is no longer active */ in ZSTDMT_flushProduced()
1479 mtctx->jobs[wJobID].frameChecksumNeeded = 0; in ZSTDMT_flushProduced()
1483 … size_t const toFlush = MIN(cSize - mtctx->jobs[wJobID].dstFlushed, output->size - output->pos); in ZSTDMT_flushProduced()
1487 assert(cSize >= mtctx->jobs[wJobID].dstFlushed); in ZSTDMT_flushProduced()
1488 assert(mtctx->jobs[wJobID].dstBuff.start != NULL); in ZSTDMT_flushProduced()
1491 (const char*)mtctx->jobs[wJobID].dstBuff.start + mtctx->jobs[wJobID].dstFlushed, in ZSTDMT_flushProduced()
1495 … mtctx->jobs[wJobID].dstFlushed += toFlush; /* can write : this value is only used by mtctx */ in ZSTDMT_flushProduced()
1498 …&& (mtctx->jobs[wJobID].dstFlushed == cSize) ) { /* output buffer fully flushed => free this job… in ZSTDMT_flushProduced()
1500 mtctx->doneJobID, (U32)mtctx->jobs[wJobID].dstFlushed); in ZSTDMT_flushProduced()
1501 ZSTDMT_releaseBuffer(mtctx->bufPool, mtctx->jobs[wJobID].dstBuff); in ZSTDMT_flushProduced()
1503 mtctx->jobs[wJobID].dstBuff = g_nullBuffer; in ZSTDMT_flushProduced()
1504 …mtctx->jobs[wJobID].cSize = 0; /* ensure this job slot is considered "not started" in future che… in ZSTDMT_flushProduced()
1511 if (cSize > mtctx->jobs[wJobID].dstFlushed) return (cSize - mtctx->jobs[wJobID].dstFlushed); in ZSTDMT_flushProduced()
1514 if (mtctx->doneJobID < mtctx->nextJobID) return 1; /* some more jobs ongoing */ in ZSTDMT_flushProduced()
1517 …mtctx->allJobsCompleted = mtctx->frameEnded; /* all jobs are entirely flushed => if this one is … in ZSTDMT_flushProduced()
1537 ZSTD_PTHREAD_MUTEX_LOCK(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_getInputDataInUse()
1538 consumed = mtctx->jobs[wJobID].consumed; in ZSTDMT_getInputDataInUse()
1539 ZSTD_pthread_mutex_unlock(&mtctx->jobs[wJobID].job_mutex); in ZSTDMT_getInputDataInUse()
1541 if (consumed < mtctx->jobs[wJobID].src.size) { in ZSTDMT_getInputDataInUse()
1542 range_t range = mtctx->jobs[wJobID].prefix; in ZSTDMT_getInputDataInUse()
1545 range = mtctx->jobs[wJobID].src; in ZSTDMT_getInputDataInUse()
1548 assert(range.start <= mtctx->jobs[wJobID].src.start); in ZSTDMT_getInputDataInUse()
1812 * still compression jobs ongoing. in ZSTDMT_compressStream_generic()