You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The zstandard wrappers should be thread-safe and should not allow any multithreaded use (particularly under the free-threaded build) that is not considered safe by the zstandard C library.
Another thing to look at is using TSAN to verify thread safety in the C extension. I don't know offhand about if you have to do anything special to use TSAN with new tests in the CPython test suite.
To follow up here, I pushed 6d36249 a few days ago with some freethreaded tests. I want to expand this to (de)compress and test sharing a ZstdDict across threads.
I ran the tests with tsan on and the GIL disabled and they passed. I'm not sure if I need to do anything else to have the tests use tsan specially, but the tests did print out == sanitizers: thread, so it picked up that it was available.
Proposal:
The zstandard wrappers should be thread-safe and should not allow any multithreaded use (particularly under the free-threaded build) that is not considered safe by the zstandard C library.
Another thing to look at is using TSAN to verify thread safety in the C extension. I don't know offhand about if you have to do anything special to use TSAN with new tests in the CPython test suite.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
Rogdham/pyzstd#32 (comment)
The text was updated successfully, but these errors were encountered: