Closed heri16 closed 4 months ago
Fixes Issue #1
All tests passing.
lgtm
A bun test that checks if ThreadpoolExecutor is behaving correctly within bun_python would be nice to detect any regression in future.
https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor
it seems doesn't work
I think it may related to bun's runtime behavior the thread may never working since you cannot fork the javascript core runtime
Release Python's Global Interpreter Lock (GIL) when calling into JS Callbacks from Python.
Also release the GIL after each call into Python from JS, to allow python
threading
andmultiprocessing
library to function properly. See Python docs on Thread State and the Global Interpreter Lock.This is also a prerequisite for reliable python3
asyncio
support coming in future tobun_python
.