File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11### acefile 0.6.14-dev
22
3+ - Experimental support for free-threaded Python.
34- Fix memory leak in acebitstream module.
45- Add pytest smoke tests and configure GitHub Actions CI for testing.
56- Remove deprecated setup.py features.
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ Typical use of :mod:`acefile` has the following structure:
2222 See :class: `acefile.AceArchive ` and :class: `acefile.AceMember ` for the
2323complete descriptions of the methods supported by these two classes.
2424
25+ On free-threaded Python, :mod: `acefile ` is only thread-safe as long as only a
26+ single thread operates on any given :class: `acefile.AceArchive ` at a time.
27+
2528Functions
2629~~~~~~~~~
2730
Original file line number Diff line number Diff line change @@ -290,6 +290,17 @@ PyInit_acebitstream(void)
290290 return NULL ;
291291 }
292292
293+ #ifdef Py_GIL_DISABLED
294+ /*
295+ * There are no critical sections, because the premise is that
296+ * decompression from the same file-like object is inherently not
297+ * thread-safe. Decompressing archive members from the same non-solid
298+ * archive in parallel would need to be made thread-safe at a higher
299+ * layer than reading bits from a file-like object.
300+ */
301+ PyUnstable_Module_SetGIL (module , Py_MOD_GIL_NOT_USED );
302+ #endif
303+
293304 Py_INCREF (& BitStreamType );
294305 PyModule_AddObject (module , "BitStream" , (PyObject * )& BitStreamType );
295306 return module ;
You can’t perform that action at this time.
0 commit comments