edgarrmondragon commented on PR #1035: URL: https://github.com/apache/arrow-nanoarrow/pull/1035#issuecomment-7319397700
> First, I think we should not use pytest-parallel here...that style of testing is really only useful in the presence of mutable module globals, and that is not a current concern. In other words, I don't think it is testing anything we care about. Ok, that makes sense. I'll drop pytest-parallel. > Second, while the test you added does exercise some degree of making sure this works under free threading, it doesn't update the Cython module to actually be free threaded safe. Notably, the sections where we currently have `with gil` are where we mess with reference counts and I think we may need `cython.critical_section(self)` or `cython.pymutex`. . Note that we also added in this release native C support for shared buffers and shared arrays, so we may want to migrate to that (although it seems easier to start with the cython utilities and move to a lighter solution if that impacts performance). Gotcha. In my limited understanding, refcounting should itself be thread-safe, so the `with gil` blocks are probably OK. Other shared mutable state (global or not) could still be a problem, so I'll look for that kind of thing (e.g. moving/releasing arrays and streams) and try running the threading tests under TSan on a 3.15t build. > If I'm off base with that, feel free to add an explanation in a comment next to the -Xfreethreading_compatible=True and update the PR. I'll work on this and then either push some fixes or add the comment next to `-Xfreethreading_compatible=True`. This becomes a draft in the meantime. Thanks for reviewing! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
