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

thread states should use a doubly-linked list #62112

Closed
pitrou opened this issue May 5, 2013 · 6 comments
Closed

thread states should use a doubly-linked list #62112

pitrou opened this issue May 5, 2013 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented May 5, 2013

BPO 17912
Nosy @pitrou
Files
  • pystate.diff
  • 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 2013-05-08.20:53:00.756>
    created_at = <Date 2013-05-05.22:02:39.502>
    labels = ['interpreter-core', 'type-feature']
    title = 'thread states should use a doubly-linked list'
    updated_at = <Date 2013-05-08.20:53:00.755>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2013-05-08.20:53:00.755>
    actor = 'neologix'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-05-08.20:53:00.756>
    closer = 'neologix'
    components = ['Interpreter Core']
    creation = <Date 2013-05-05.22:02:39.502>
    creator = 'pitrou'
    dependencies = []
    files = ['30168']
    hgrepos = []
    issue_num = 17912
    keywords = ['patch', 'needs review']
    message_count = 6.0
    messages = ['188471', '188581', '188586', '188638', '188715', '188733']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue17912'
    versions = ['Python 3.4']

    @pitrou
    Copy link
    Member Author

    pitrou commented May 5, 2013

    Thread states are stored in a singly linked list, which makes some operations more cumbersome than they should be. Since memory consumption is far from critical here, it would be easier to handle them with a doubly linked list.

    @pitrou pitrou added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels May 5, 2013
    @neologix
    Copy link
    Mannequin

    neologix mannequin commented May 6, 2013

    Are there other places in the code base using linked-list?
    If yes, I think it could be interesting to add a generic linked-list
    implementation, like the one used in the Linux kernel:
    http://kernelnewbies.org/FAQ/LinkedLists
    http://isis.poly.edu/kulesh/stuff/src/klist/

    @pitrou
    Copy link
    Member Author

    pitrou commented May 6, 2013

    Are there other places in the code base using linked-list?
    If yes, I think it could be interesting to add a generic linked-list
    implementation, like the one used in the Linux kernel:
    http://kernelnewbies.org/FAQ/LinkedLists
    http://isis.poly.edu/kulesh/stuff/src/klist/

    There are a couple other places, IIRC. That said, I'm not sure what the
    point is, since a linked list is quite a simple structure anyway?

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented May 7, 2013

    There are a couple other places, IIRC. That said, I'm not sure what the
    point is, since a linked list is quite a simple structure anyway?

    Well, it was just to avoid code duplication, and gain a nice iteration macro ;-)

    Anyway, I'll submit a patch later today.

    @pitrou
    Copy link
    Member Author

    pitrou commented May 8, 2013

    Your patch looks fine to me, thank you.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 8, 2013

    New changeset 375d4fed4cf2 by Charles-Francois Natali in branch 'default':
    Issue bpo-17912: Use a doubly linked-list for thread states.
    http://hg.python.org/cpython/rev/375d4fed4cf2

    @neologix neologix mannequin closed this as completed May 8, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant