Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithread dispatcher - initialize with available CPU cores #501

Open
edualonso opened this issue Oct 12, 2021 · 0 comments
Open

Multithread dispatcher - initialize with available CPU cores #501

edualonso opened this issue Oct 12, 2021 · 0 comments

Comments

@edualonso
Copy link
Contributor

edualonso commented Oct 12, 2021

We should have a multi threaded dispatcher to dispatch ex. background network rework requests in KtorNetworkTransport (#450).

This is immediately available for JVM through

Executors.newFixedThreadPool(size).asCoroutineDispatcher()

For native we might be able to leverage NsQueueDispatcher from our test module.

Processor count is available through

// JVM
Runtime.getRuntime().availableProcessors();
// Darwin
NSProcessInfo.Companion.processInfo(). activeProcessorCount

https://developer.apple.com/documentation/foundation/nsprocessinfo/1408184-activeprocessorcount

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant