Skip to content

Commit

Permalink
Have sharedOperationQueue have at least 2 max operations. (#139)
Browse files Browse the repository at this point in the history
On devices without multiple cores it's still useful to allow multiple
operations to run at once.
  • Loading branch information
garrettmoon authored Nov 3, 2016
1 parent 36b21b4 commit 910dd88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PINCache/PINOperationQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ + (instancetype)sharedOperationQueue
static PINOperationQueue *sharedOperationQueue = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedOperationQueue = [[PINOperationQueue alloc] initWithMaxConcurrentOperations:[[NSProcessInfo processInfo] activeProcessorCount]];
sharedOperationQueue = [[PINOperationQueue alloc] initWithMaxConcurrentOperations:MAX([[NSProcessInfo processInfo] activeProcessorCount], 2)];
});
return sharedOperationQueue;
}
Expand Down

0 comments on commit 910dd88

Please sign in to comment.