-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for no-gil/freethreaded work #4265
Tracking issue for no-gil/freethreaded work #4265
Comments
As a tiny piece of this and to try to learn the library better, I'm working on adding wrappers for the new |
Just to update the current state of things: pyo3 builds against the free-threaded build if you do:
If you use pyenv, you'll also need to locally delete or modify the This very quicky crashes inside of mimalloc internals, ultimately inside of
Just to make sure all of this is reproducible and we have some feedback on CI, I think I'm going to add a free-threaded CI job marked with |
That sounds great to me, thanks! |
* Update dict.get_item binding to use PyDict_GetItemRef Refs #4265 * test: add test for dict.get_item error path * test: add test for dict.get_item error path * test: add test for dict.get_item error path * fix: fix logic error in dict.get_item bindings * update: apply david's review suggestions for dict.get_item bindings * update: create ffi::compat to store compatibility shims * update: move PyDict_GetItemRef bindings to spot in order from dictobject.h * build: fix build warning with --no-default-features * doc: expand release note fragments * fix: fix clippy warnings * respond to review comments * Apply suggestion from @mejrs * refactor so cfg is applied to functions * properly set cfgs * fix clippy lints * Apply @davidhewitt's suggestion * deal with upstream deprecation of new_bound
I added a new checkbox for " Adopt new owned-reference-friendly C APIs". If we have a list of all the ones we need, I can make those sub-checkboxes. |
I think I also had a chat with @davidhewitt today and in addition to Our first idea is to make GILProtected a no-op on In addition we need to use I looked at adding a failing CI job, but that won't work right now because of if you run the tests on a free-threaded build with |
Ok, updated the tracking list.
|
I'm still learning the library and it shows... I think David meant |
My guess is it's a reference to |
My mistake, yes we removed the |
See #4421 which updates the FFI bindings for the free-threaded build. That's enough to get the tests to pass without deadlocking, so I added a CI config as well. |
Added a checkbox for |
I've been experimenting with
(here I'm using a slightly modified version of cargo-stress to get better error reporting, see danhhz/cargo-stress#6). I don't understand how we could be getting a UTF-8 decode error while defining a class. This could be a sign of some thread-safety issue in |
Hmm, we just had the same issue in https://github.com/PyO3/pyo3/actions/runs/11054116502/job/30710180455#step:9:5074 |
Ohhh, I get it, it's because |
Good point, I will try to fix that PR up next time I type a line of code! |
Ah, just realised #4584 - I've added a checkbox for |
really looking forward to this! |
#4298 might imply |
As per python/cpython#125243 (comment) I've added a bullet to the top for datetime bindings. |
Are we good for |
Yes, we should be. The concern about thread safety in the |
God help us, we're close. Has anyone here done a top to bottom perusal of pyo3 for other potential concerns? |
Not me. I did just grep the codebase for I'm also hoping that finishing up #4566 will elucidate any remaining issues in tests and docs. My plan is to help finish that up next week. |
I've got a long train ride tomorrow, so I may take another top to bottom
pass
…On Fri, Oct 25, 2024 at 5:43 PM Nathan Goldbaum ***@***.***> wrote:
Has anyone here done a top to bottom perusal of pyo3 for other potential
concerns?
Not me. I did just grep the codebase for Cell and UnsafeCell uses, and I
think all the remaining ones are safe? The fact that PyAny uses an
UnsafeCell to wrap a PyObject * pointer is OK, right?
I'm also hoping that finishing up #4566
<#4566> will elucidate any remaining
issues in tests and docs. My plan is to help finish that up next week.
—
Reply to this email directly, view it on GitHub
<#4265 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBCEJZGM4BM25NZIEULZ5K3QFAVCNFSM6AAAAABJTCDPMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZYHEZDCNZUGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
My orm Dependency pydantic。 |
See #4651 . We will be releasing initial support very soon, some challenges at home have delayed the work. Thank you for your patience. |
FYI, if you ended up here because your Github Action reported your Python version (e.g. 3.8) was not compatible with a GIL-free build of Python, check your configuration of the |
hopefully this will let us solve this issue: PyO3/pyo3#4265 (comment)
We didn't have a dedicated issue for this, so now there's one.
TODO:
cfg
for no-gil, but only allowed behind an experimental featureffi-check
passing with a no-GIL buildPyDict_GetItemRef
PyList_GetItemRef
PyDict_Next
PyWeakref_GetRef
PyImport_AddModuleRef
Python<'_>
indicates only a single thread is executing:pyo3::sync::GILOnceCell
PyClassBorrowChecker
GILProtected
PyErrState::normalize
Py_mod_gil
slot should be setdatetime
bindings are not thread safe (?)The text was updated successfully, but these errors were encountered: