This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: thread states should use a doubly-linked list
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, pitrou, python-dev
Priority: low Keywords: needs review, patch

Created on 2013-05-05 22:02 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pystate.diff neologix, 2013-05-07 17:31 review
Messages (6)
msg188471 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-05 22:02
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.
msg188581 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-05-06 20:12
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/
msg188586 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-06 20:22
> 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?
msg188638 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2013-05-07 10:43
> 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.
msg188715 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-08 11:31
Your patch looks fine to me, thank you.
msg188733 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-08 19:10
New changeset 375d4fed4cf2 by Charles-Francois Natali in branch 'default':
Issue #17912: Use a doubly linked-list for thread states.
http://hg.python.org/cpython/rev/375d4fed4cf2
History
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62112
2013-05-08 20:53:00neologixsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-05-08 19:10:30python-devsetnosy: + python-dev
messages: + msg188733
2013-05-08 11:31:26pitrousetmessages: + msg188715
2013-05-07 17:31:12neologixsetkeywords: + patch, needs review
files: + pystate.diff
stage: needs patch -> patch review
2013-05-07 10:43:28neologixsetmessages: + msg188638
2013-05-06 20:22:56pitrousetmessages: + msg188586
2013-05-06 20:12:31neologixsetmessages: + msg188581
2013-05-06 19:37:40pitrousetnosy: + neologix
2013-05-05 22:02:39pitroucreate