Release the GIL during liberasurecode encode/decode/reconstruct
Holding the GIL for the whole C computation kept callers from overlapping erasure coding with other work or spreading it across cores.
Only the liberasurecode_* calls run without the GIL, never any CPython API. Input buffers are borrowed from immutable bytes the caller still holds.
Only do this on liberasurecode 1.8.0 and newer, which holds a read lock across the operation – and thereby asserts its backends are reentrant on a shared descriptor. Older versions walk their instance list unlocked, so an operation overlapping an ECDriver being created or destroyed would race it; the GIL is what kept those apart.
With the threaded bench in change 991506 this scales 425 -> 790 -> 1484 MB/s at -t 1/2/4, against a flat 414 -> 423 without.
Add a test driving a shared driver from several threads.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com Change-Id: Ie06eab1d5954e059a9b69b2b08b859ac1b063d06 Signed-off-by: Christian Schwede cschwede@mailbox.org
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号