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-112075: Make instance attributes stored in inline "dict" thread safe by DinoV · Pull Request #114742 · python/cpython Conversation
|
|
This looks inefficient, we really don't want locks in the fast path for attribute lookup. Rather than putting locks around things, maybe we can revisit the way we handle objects with managed dictionaries to consider free-threading? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I assume you're referring to the latest unfinished version (as previous one only added a lock for dematerialization which as @colesbury pointed out isn't correct)? If so there aren't actually any locking for lookups in the fast path... There is an read w/ acquire semantics, but on strongly-ordered systems like x64 that's no different than a normal read anyway. It does introduce an incref/decref when reading from the dictionary. Also FWIW I think I don't need the spinning in I think we could get rid of the incref though if we disabled dematerialization in free-threading, but there's still going to be some ref count checks to see if the object is local, and if not to mark it as shared so that we'll free the values via QSBR. I'm not sure that can be avoided. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've run into an existing complication with the existing solution I've been trying. The limitation in the byte code generator " Until the last It also occurred to me that we're not just racing with de-materialization of the dict, but we're also racing with someone assigning to So an alternate plan might be:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
eadcc3e to
3c3537e
Compare
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.
f896695 to
b5a3231
Compare
|
🤖 New build scheduled with the buildbot fleet by @colesbury for commit fc7d1a4 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fc7d1a4 to
4b85255
Compare
|
🤖 New build scheduled with the buildbot fleet by @DinoV for commit 4b85255 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @DinoV for commit fac83b7 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fix issue where critical section isn't released Make _PyObject_TryGetInstanceAttribute return a bool
…issue w/ deleted dict
…y materialized dict Fix duplicate incref Fix comment Remove redundant if check on detach
|
🤖 New build scheduled with the buildbot fleet by @DinoV for commit fac83b7 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fac83b7 to
ac503e8
Compare
|
🤖 New build scheduled with the buildbot fleet by @DinoV for commit ac503e8 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Sorry, something went wrong.
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.