| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @MojoVampire - this looks good. I left some comments below.
Sorry, something went wrong.
|
I've edited the PR title and comment a bit. Feel free to edit them further, if you would like. |
Sorry, something went wrong.
|
@colesbury: I think I've addressed everything. Thanks for the quick review! |
Sorry, something went wrong.
… test for regressions
…sts segfault or die with assertion failures >95% of the time without locking macro, pass reliably with locking macro
Use braces to restrict scope of conditional locking Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
… total time to run tests (both tests combine to less than 200 ms in debug build on my laptop)
…section include Python.h which provides listobject.h)
…onize, and perform multiple joins per loop to increase chance of repro without synchronization
|
@DinoV & @colesbury: What needs to happen to perform the final merge? I rebased a few minutes ago to be sure it was fully up-to-date with main, not really sure what the next step is now that it's been reviewed. |
Sorry, something went wrong.
|
I'll merge it after the CI passes |
Sorry, something went wrong.
|
Thanks @MojoVampire for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
…eaded build (pythonGH-119315) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch. (cherry picked from commit baf347d) Co-authored-by: Josh {*()} Rosenberg <26495692+MojoVampire@users.noreply.github.com>
|
GH-119419 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…readed build (GH-119315) (#119419) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch. (cherry picked from commit baf347d) Co-authored-by: Josh {*()} Rosenberg <26495692+MojoVampire@users.noreply.github.com>
|
@MojoVampire Thanks for the PR, the Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST is just what I needed. I have a question on the usage of Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST : can it also be used when code inside the critical section tries to acquire a lock on the same object? I am trying to use it to make _json thread safe, but my test case keeps locking in the free-threaded build. Usage is here: https://github.com/python/cpython/pull/119438/files#diff-efe183ae0b85e5b8d9bbbc588452dd4de80b39fd5c5174ee499ba554217a39edR1667 |
Sorry, something went wrong.
Found it! Works, but one has to take care of goto statements in the code that can jump beyond the Py_END_CRITICAL_SECTION_SEQUENCE_FAST. |
Sorry, something went wrong.
…eaded build (python#119315) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch.
| Back | FazBrowse Home | New Git URL |
Add Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST and Py_END_CRITICAL_SECTION_SEQUENCE_FAST macros and update str.join to use them. Also add a regression test that would crash reliably without this patch.