-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Change --ponyminthreads
default to 0
#3020
Conversation
The commands I used for testing are the following: Start data receiver (from wallaroo) to listen on port 9999: Run sender (from wallaroo) to send data every 10 ms to port 9999 for about 15 mins at a time. 10 ms is used to give scheduler thread 0 enough time to sleep between batches. Run the |
src/libponyc/options/options.c
Outdated
@@ -197,8 +197,7 @@ static void usage(void) | |||
" --ponythreads Use N scheduler threads. Defaults to the number of\n" | |||
" cores (not hyperthreads) available.\n" | |||
" --ponyminthreads Minimum number of active scheduler threads allowed.\n" | |||
" Defaults to 1. Use of 0 is considered experimental\n" | |||
" and may cause improper scheduler behavior.\n" | |||
" Defaults to 0.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we explain what zero means here?
It's not immediately clear to me and the same will likely be true for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jemc The 0
means that it allows all scheduler threads to suspend resulting in a more efficient application with no busy polling at all when there is no work to be done (the ASIO thread is still awake and will wake up a scheduler thread when more work needs to be done either due to a timer, or network io, or some other similar event). --ponyminthreads
controls the minimum number of scheduler threads that must be active (and busy polling for work), no matter what.
I'm not sure if you meant for me to include what 0
means in the help text. If so, I'm not sure of a succinct way to write that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: Defaults to 0, meaning that all scheduler threads are allowed to be suspended when no work is available
@dipinhora can you write up the release notes to be included with this? |
@SeanTAllen Release notes: Change the |
This can be merged once the help output is updated. |
Thanks to @slfritchie's hard work in ponylang#2926 and ponylang#2561 to find and fix the bugs in the dynamic scheduler scaling logic, scheduler thread 0 now also suspends and resumes correctly without issues (in my testing). This commit changes the default for `--ponyminthreads` from `1` to `0`. The last time @slfritchie ran into issues was in March and left a comment with the commands he used at: ponylang#2561 (comment) I ran the commands from @slfritchie's comment (with minor changes to ensure `--ponyminthreads=0`) using Pony 0.26.0 for a few hours without any issues.
c7db962
to
882b89d
Compare
Help output updated and PR rebased onto latest master. |
I'll merge this once it passes CI |
Thanks to @slfritchie's hard work in #2926 and #2561 to find and
fix the bugs in the dynamic scheduler scaling logic, scheduler
thread 0 now also suspends and resumes correctly without issues
(in my testing).
This commit changes the default for
--ponyminthreads
from1
to0
. The last time @slfritchie ran into issues was in March andleft a comment with the commands he used at:
#2561 (comment)
I ran the commands from @slfritchie's comment (with minor changes
to ensure
--ponyminthreads=0
) using Pony 0.26.0 for a few hourswithout any issues.