Uh oh!
There was an error while loading. Please reload this page.
gh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT - #130372
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6f8b1d7 to
15c28cbCompare| #ifdef Py_GIL_DISABLED | ||
| _PyDict_EnsureSharedOnRead(dict_o); | ||
| #endif |
There was a problem hiding this comment.
I think we should de-opt here if the condition doesn't hold. The critical section is escaping so previously validated guards might not hold.
Something like:
EXIT_IF(!_Py_IsOwnedByCurrentThread((PyObject *)dict_o) && !IS_DICT_SHARED(dict_o));
EDIT: EXIT_IF instead of DEOPT_IF
There was a problem hiding this comment.
I think we need to do DEOPT_IF because apparently we can't mix and match them. I've updated it to do the ownership check and then mark the dictionary as shared when doing the specialization.
mpage
commented
Mar 17, 2025
@DinoV - this lgtm modulo Sam's comment. Can you take a look? |
b666cd0 to
2fbeb0bComparempage
commented
Mar 24, 2025
LGTM. The tail calling check failure should go away if you merge main. Not sure about the other failing check. |
2fbeb0b to
aeb389dCompare
Adds a lock-free lookup of the hinted location
https://github.com/facebookexperimental/free-threading-benchmarking/tree/main/results/bm-20250219-3.14.0a5+-6a1fe7e-NOGIL