Skip to content

Inconsistency between stack size in main thread and secondary threads on macOS #78445

Closed

Description

@ronaldoussoren
BPO 34264
Nosy @ronaldoussoren, @ned-deily
PRs
  • bpo-34264: [macOS] make stack size of created threads same as on main… #8534
  • Superseder
  • bpo-18049: Re-enable threading test on macOS
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-07-13.14:14:06.057>
    created_at = <Date 2018-07-28.16:00:44.920>
    labels = ['OS-mac', 'interpreter-core', 'type-feature', '3.8']
    title = 'Inconsistency between stack size in main thread and secondary threads on macOS'
    updated_at = <Date 2019-07-13.14:14:06.056>
    user = 'https://github.com/ronaldoussoren'

    bugs.python.org fields:

    activity = <Date 2019-07-13.14:14:06.056>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-13.14:14:06.057>
    closer = 'ronaldoussoren'
    components = ['Interpreter Core', 'macOS']
    creation = <Date 2018-07-28.16:00:44.920>
    creator = 'ronaldoussoren'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34264
    keywords = ['patch']
    message_count = 3.0
    messages = ['322569', '322573', '347825']
    nosy_count = 2.0
    nosy_names = ['ronaldoussoren', 'ned.deily']
    pr_nums = ['8534']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '18049'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34264'
    versions = ['Python 3.8']

    Activity

    1. ronaldoussoren commented on Jul 28, 2018

      @ronaldoussoren
      ContributorAuthor

      configure.ac sets the stack size for the main thread on macOS to 1000000 (hex), while Python/threading_pthread.h sets the default stack size for other threads to 0x500000. The latter is half of the former.

      IMHO both should be the same, as both claim to have been chosen to be just large enough to accommodate the default recursion limit.

      I'd prefer to increase the default stack size of secondary threads to match the main thread. I tagged this as a 3.8 thread because there is a (very) small chance that changing the stack size breaks existing programs (although you'd have to create a lot of threads to use a significant amount of memory).

      This is vaguely related to bpo-33955.

    2. ronaldoussoren commented on Jul 28, 2018

      @ronaldoussoren
      ContributorAuthor

      PS. A pull request will follow shortly.

    3. ronaldoussoren commented on Jul 13, 2019

      @ronaldoussoren
      ContributorAuthor

      This is a duplicate of 18049, which has a more complete patch.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeOS-macinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions