Suzhou-Tongyuan / jnumpy

Writing Python C extensions in Julia within 5 minutes.
MIT License
234 stars 8 forks source link

usability & engineerization: invalidation of the external libpython pointer #42

Closed thautwarm closed 2 years ago

thautwarm commented 2 years ago

Users can spawn subprocesses from existing Julia/Python, which inherits environment variables including CF_TYPY_PY_APIPTR.

However, CF_TYPY_PY_APIPTR inherited from the parent process is invalid.

We need an another auxiliary environment variable CF_TYPY_PID. It should be initialized using getpid() in Julia, or os.getpid() in Python. CF_TYPY_PY_APIPTR is valid only if CF_TYPY_PID equals to the identity of the current process.