Skip to content

feat: add env vars to configure the runtime threadpool size and name #774

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 19, 2020

Conversation

jbr
Copy link
Contributor

@jbr jbr commented May 11, 2020

I read the thread at #690 and this seemed like an easy change to make.

I tried to find a good balance between accurate-but-verbose (ASYNC_STD_RT_POOL_SIZE, ASYNC_STD_RT_THREAD_NAME) and concise-but-generic (RT_THREADS, RT_NAME).

Would people want to be able to optionally include the thread number in the thread name? I'm not certain why they would want to, but I believe I've seen that in other threadpools. If so, the thread name variable might include some substitution placeholder.

docs:

image

@jbr jbr changed the title Add an env var to configure the smol runtime threadpool size Add a env vars to configure the smol runtime threadpool size and name May 11, 2020
@jbr jbr changed the title Add a env vars to configure the smol runtime threadpool size and name Add env vars to configure the smol runtime threadpool size and name May 11, 2020
@jbr jbr force-pushed the rt-threads-env-var branch from 413ca84 to 0b151d6 Compare May 11, 2020 20:44
@dignifiedquire
Copy link
Member

  • I think we would want to document this in the top level docs and the task docs.
  • This looks good from my side, but it changes things, such that we now allog configuration, would like to get some feedback from @skade and @yoshuawuyts before merging

Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches what we've been talking about for a while. LGTM!

@jbr jbr force-pushed the rt-threads-env-var branch from 067d70f to 21fbdf6 Compare May 13, 2020 21:14
@jbr
Copy link
Contributor Author

jbr commented May 13, 2020

Added docs and a screenshot.

I was unsure if the documentation should explain the difference between parallelism and concurrency in an async environment, or trust that the reader understand that ASYNC_STD_NUM_THREADS isn't the ceiling on concurrency

@dignifiedquire
Copy link
Member

Thank you @jbr lets get this in and see how it works out

@dignifiedquire dignifiedquire changed the title Add env vars to configure the smol runtime threadpool size and name feat: add env vars to configure the runtime threadpool size and name May 19, 2020
@dignifiedquire dignifiedquire merged commit 9e6a76a into async-rs:master May 19, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants