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

If the user explicitly asked for 1 thread don't add an interactive one. #57454

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gbaraldi
Copy link
Member

This basically makes the assumption that if the user asked for 1 thread they really want their program to not have threads

This basically makes the assumption that if the user asked for 1 thread they really want their program to not have threads
@IanButterworth
Copy link
Member

IanButterworth commented Feb 18, 2025

As this introduces a complexity to the setting, I think this need the docs to be updated to understand how clear this would be i.e. both -t and JULIA_NUM_THREADS behavior

@giordano giordano added multithreading Base.Threads and related functionality backport 1.12 Change should be backported to release-1.12 labels Feb 18, 2025
@topolarity topolarity requested a review from xal-0 February 18, 2025 16:41
@IanButterworth

This comment was marked as resolved.

@KristofferC KristofferC mentioned this pull request Feb 21, 2025
24 tasks
@IanButterworth IanButterworth added the needs tests Unit tests are required for this change label Feb 21, 2025
Copy link
Member

@IanButterworth IanButterworth left a comment

Choose a reason for hiding this comment

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

Makes sense to me, just needs a test alongside the ones that check threadpool sizes.

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

This sort of thing seems very unintuitive. Why are we getting hidden unexplained threads at all when the user didn't ask for them?

@IanButterworth
Copy link
Member

IanButterworth commented Feb 22, 2025

Because the default number of interactive threads changed. See motivation in #57087

From discussion in the multithreading call there was general agreement that while this is complication of a simple rule, -t1 does seem like a case worth special casing:

-t2 : most likely you would benefit from separating main task (& io loop), and tasks on worker threads.
-tauto: same as above
-t1: you probably want specifically one thread because otherwise you'd just leave the default -t1,1

@KristofferC KristofferC mentioned this pull request Feb 26, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.12 Change should be backported to release-1.12 multithreading Base.Threads and related functionality needs tests Unit tests are required for this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants