Message402571
To be clear, the problem I'm trying to address here is not specific to embedding Python in a C++ application. In fact the issue came to my attention while using Python directly, but loading an extension module that was written in C++ using the popular pybind11 library.
If we continue having Python call `pthread_exit` and `_endthreadex`, we are imposing strong constraints on call stacks that call the Python API. Granted, hanging a thread is also not something a well-behaved library should do, but it is at least slightly better than killing the thread. In a sense hanging is also logical, since the thread has requested to block until the GIL can be acquired, and the GIL cannot be acquired.
I have described a number of problems caused by `pthread_exit`/`_endthreadex` that are fixed by hanging. Can you help me understand what problems caused by hanging are fixed by `pthread_exit`/`_endthreadex`, that leads you to think it is a better default? |
|
Date |
User |
Action |
Args |
2021-09-24 15:24:27 | jbms | set | recipients:
+ jbms, gregory.p.smith, vstinner, izbyshev |
2021-09-24 15:24:27 | jbms | set | messageid: <1632497067.59.0.160724376888.issue42969@roundup.psfhosted.org> |
2021-09-24 15:24:27 | jbms | link | issue42969 messages |
2021-09-24 15:24:27 | jbms | create | |
|