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

bpo-18049: Sync thread stack size to main thread size on macOS #14748

Merged
merged 2 commits into from
Aug 1, 2019

Conversation

ronaldoussoren
Copy link
Contributor

@ronaldoussoren ronaldoussoren commented Jul 13, 2019

This changeset increases the size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.

https://bugs.python.org/issue18049

This changeset increases the size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
@ronaldoussoren
Copy link
Contributor Author

Is this something that can be back ported to 3.8 as it is still in beta?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -0,0 +1,2 @@
Increase stack size of threads to 16MB on macOS, to match the stack size of
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind to mention the old value, 5 MiB?

You may specify that it's the default size: it can be overriden by _thread.stack_size(size).

@vstinner
Copy link
Member

Is this something that can be back ported to 3.8 as it is still in beta?

For me it's a bugfix and so can be backported.

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

LGTM. Sure, I think backporting to 3.8 is fine. I will run more tests on older versions of macOS before the next beta.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. I just have a minor comment.

@@ -0,0 +1,3 @@
Increase the default stack size of threads from 5MB to 16MB on macOS, to
Copy link
Member

Choose a reason for hiding this comment

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

nitpick:

Suggested change
Increase the default stack size of threads from 5MB to 16MB on macOS, to
Increase the default stack size of threads from 5 MiB to 16 MiB on macOS, to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is MiB something we use elsewhere?

I'm probably old, but don't particularly like the MiB vs. MB distinction as it is often clear from the context what's meant.

@vstinner
Copy link
Member

Is MiB something we use elsewhere? I'm probably old, but don't particularly like the MiB vs. MB distinction as it is often clear from the context what's meant.

Well, it's not a big deal, just a remark. I already approved your PR twice ;-) It's up to you.


For MiB, see my PR #4293: "kB (kilo byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate."

And my commit 8c663fd:

commit 8c663fd60ecba9c82aa4c404dbfb1aae69fe8553
Author: Victor Stinner <victor.stinner@gmail.com>
Date:   Wed Nov 8 14:44:44 2017 -0800

    Replace KB unit with KiB (#4293)

5 MB means 5 000 000 bytes, not 5*1024*1024 = 5242880 bytes.

Sadly MB (megabyte) is used instead of MiB in many places (outside Python).

#define THREAD_STACK_SIZE 0x1000000 is 16 MiB ;-)

https://en.wikipedia.org/wiki/Megabyte

@ronaldoussoren ronaldoussoren merged commit 1a057ba into python:master Aug 1, 2019
@miss-islington
Copy link
Contributor

Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 1, 2019
…nGH-14748)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
(cherry picked from commit 1a057ba)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
@bedevere-bot
Copy link

GH-15065 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Aug 1, 2019
)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
(cherry picked from commit 1a057ba)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…nGH-14748)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…nGH-14748)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…nGH-14748)

This changeset increases the default size of the stack
for threads on macOS to the size of the stack
of the main thread and reenables the relevant
recursion test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants