Title: gh-149816: fix concurrent `kwargs` growth in `_thread.start_new_thread` by YvesDup · Pull Request #150168 · python/cpython · GitHub
Open Graph Title: gh-149816: fix concurrent `kwargs` growth in `_thread.start_new_thread` by YvesDup · Pull Request #150168 · python/cpython
X Title: gh-149816: fix concurrent `kwargs` growth in `_thread.start_new_thread` by YvesDup · Pull Request #150168 · python/cpython
Description: IMO, to fix this issue, there are 2 options: in the PyStack_UnpackDict function located in /Objects/call.c, wraps the PyDict_Next loop in a critical section to prevent concurrent mutations of the same dict. in the /Modules/_threadmodule.c, duplicate the kwargs dict in the thread_run function, before calling the thread's main function. So that the thread will be working with a private copy of the kwargs dict. In the option 1, the PyStack_UnpackDict function is called many times, from PyObject_VectorcallDict via _PyObject_VectorcallDictTstate, PyVectorcall_Call via _PyVectorcall_Call or _PyEvalFramePushAndInit_Ex. This change is not necessary for these functions and, furthermore, would have an impact on their performance. I favor option 2, as it has a more limited scope and shouldn't have a performance impact on regular builds, while still fixing the issue for FT builds. Issue: gh-149816
Open Graph Description: IMO, to fix this issue, there are 2 options: in the PyStack_UnpackDict function located in /Objects/call.c, wraps the PyDict_Next loop in a critical section to prevent concurrent mutations of the...
X Description: IMO, to fix this issue, there are 2 options: in the PyStack_UnpackDict function located in /Objects/call.c, wraps the PyDict_Next loop in a critical section to prevent concurrent mutations of the...
Opengraph URL: https://github.com/python/cpython/pull/150168
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b3041761-e7b0-5a47-b398-678706778817 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A6EC:E7D9B:2793A61:34D17BF:6A521435 |
| html-safe-nonce | 455ab623f7f58235bc2197059e106c306fb818ea6493128f73400293b7c63503 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkVDOkU3RDlCOjI3OTNBNjE6MzREMTdCRjo2QTUyMTQzNSIsInZpc2l0b3JfaWQiOiI1OTEzOTcwODMyMjE3MDg0OTgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 50d8cf633ed5b2cab569741263fb83553cd29a4e6719745f9e407bb1c48feabd |
| hovercard-subject-tag | pull_request:3718545454 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/150168/files |
| twitter:image | https://avatars.githubusercontent.com/u/6217656?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6217656?s=400&v=4 |
| og:image:alt | IMO, to fix this issue, there are 2 options: in the PyStack_UnpackDict function located in /Objects/call.c, wraps the PyDict_Next loop in a critical section to prevent concurrent mutations of the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width