reduced POOL_resize() restriction
It's not necessary to ensure that no job is ongoing. The pool is only expanded, existing threads are preserved. In case of error, the only option is to return NULL and terminate the thread pool anyway.
This commit is contained in:
@@ -188,7 +188,6 @@ size_t POOL_sizeof(POOL_ctx *ctx) {
|
||||
/* note : only works if no job is running ! */
|
||||
static POOL_ctx* POOL_resize_internal(POOL_ctx* ctx, size_t numThreads)
|
||||
{
|
||||
if (ctx->numThreadsBusy > 0) return NULL;
|
||||
if (numThreads <= ctx->threadCapacity) {
|
||||
ctx->threadLimit = numThreads;
|
||||
return ctx;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ size_t ZSTDMT_initCStream_internal(
|
||||
|
||||
/* init */
|
||||
if (params.nbWorkers != mtctx->params.nbWorkers)
|
||||
ZSTDMT_resize(mtctx, params.nbWorkers);
|
||||
CHECK_F( ZSTDMT_resize(mtctx, params.nbWorkers) );
|
||||
|
||||
if (params.jobSize == 0) {
|
||||
params.jobSize = 1U << ZSTDMT_computeTargetJobLog(params);
|
||||
|
||||
@@ -1108,15 +1108,11 @@ size_t ZSTD_execSequence(BYTE* op,
|
||||
return sequenceLength;
|
||||
}
|
||||
/* span extDict & currentPrefixSegment */
|
||||
DEBUGLOG(2, "ZSTD_execSequence: found a 2-segments match")
|
||||
{ size_t const length1 = dictEnd - match;
|
||||
DEBUGLOG(2, "first part (extDict) is %zu bytes long", length1);
|
||||
memmove(oLitEnd, match, length1);
|
||||
op = oLitEnd + length1;
|
||||
sequence.matchLength -= length1;
|
||||
DEBUGLOG(2, "second part (prefix) is %zu bytes long", sequence.matchLength);
|
||||
match = prefixStart;
|
||||
DEBUGLOG(2, "first byte of 2nd part : %02X", *prefixStart);
|
||||
if (op > oend_w || sequence.matchLength < MINMATCH) {
|
||||
U32 i;
|
||||
for (i = 0; i < sequence.matchLength; ++i) op[i] = match[i];
|
||||
|
||||
Reference in New Issue
Block a user