Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

The number of workers should default to the number of processors rather than a fixed 4 #96

Open
StefanOltmann opened this issue Jun 14, 2022 · 2 comments

Comments

@StefanOltmann
Copy link

On my MacBook Pro with 10 cores I see that only 4 of them are used. I guess this is because the number of workers is not configurable and set to a fixed 4. This should be configurable or at least use the number of CPU cores as a default.

private val executor = BackgroundCoroutineWorkQueueExecutor<WorkItem>(4)

@benasher44
Copy link
Contributor

Good point. Making it configurable makes sense. Mind making a PR?

@StefanOltmann
Copy link
Author

Ok, I can see why making it configurable is a tough one since a companion object is used for that nice CoroutineWorker.execute() API. So I focused on just using the processor count as default for the workers on Apple targets.

@StefanOltmann StefanOltmann changed the title Make the number of workers configurable The number of workers should default to the number of processors rather than a fixed 4 Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants