GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — gh-111926: Update _weakref to be threadsafe in --disable-gil build by corona10 · Pull Request #112189 · python/cpython Conversation
|
|
I am going to work on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
There was some misunderstanding with my PR, I will re-send a patch for this :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@colesbury Hmm, I am not sure this was what you intended from #111926. IIUC, There might be two kinds of task that should be done
Please let me know if there is my misunderstanding. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This looks good, other than the issue I mention below.
We will want to make both the module-level code (like this) and the operations on the weakref object thread-safe. I think it makes sense to split them up as separate PRs as you are doing.
Regarding Argument Clinic: maybe the @critical_section directive should take an optional argument specifying which parameter name to lock. For now, I think writing the critical sections manually is fine.
The tricky bit will be making _PyWeakref_GET_REF thread-safe because the lock is in the pointed-to object (ref->wr_object), but that might change or even get deallocated. I think that will need an operation _Py_TryXFetchRef from nogil-3.12 that isn't upstreamed yet. It may be worth doing the other bits and leaving _PyWeakref_GET_REF for last
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.