mirror of
https://github.com/facebook/zstd.git
synced 2024-11-24 01:56:47 +08:00
Fix AsyncIO reading seed queueing (#3940)
Fixes a bug in AsyncIO where we queue reads after opening a file so our queue will always be saturated (or as saturated as possible). Previous code was looping up to `availableJobsCount` not realizing `availableJobsCount` was also decreasing in each iteration, so instead of queueing 10 jobs we'd queue 5 (and instead of 2 we'd queue 1). This PR fixes the loop to queue as long as `availableJobsCount` is not 0.
This commit is contained in:
parent
a4db145900
commit
edab9eed66
@ -514,8 +514,7 @@ static void AIO_ReadPool_enqueueRead(ReadPoolCtx_t* ctx) {
|
||||
}
|
||||
|
||||
static void AIO_ReadPool_startReading(ReadPoolCtx_t* ctx) {
|
||||
int i;
|
||||
for (i = 0; i < ctx->base.availableJobsCount; i++) {
|
||||
while(ctx->base.availableJobsCount) {
|
||||
AIO_ReadPool_enqueueRead(ctx);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user