blosc2.set_releasegil#

blosc2.set_releasegil(gilstate: bool) bool#

Set whether to release the Python global inter-lock (GIL) during c-blosc compress and decompress operations or not. This defaults to False.

Parameters:

gilstate (bool) – True to release the GIL, False to retain it.

Returns:

out – The previous value of the Python global inter-lock (GIL) release state.

Return type:

bool

Notes

Designed to be used with larger chunk sizes and a ThreadPool. There is a small performance penalty with releasing the GIL that will more harshly penalize small block sizes.

Examples

>>> oldReleaseState = blosc2.set_releasegil(True)