TBB deadlocks pybind11 app due to mistreatment of GIL
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
@wjakob, you like TBB, do you? So may I offer an issue combining pybind11 and TBB. The idea is we want a user to provide a Python function that shall be called from within the multithreaded TBB context. Apparently, TBB deadlocks the application due to mistreatment of GIL. I was not able to get gil_scoped_acquire/gil_scoped_release to resolve this. Could you please kindly take a look:
SO question: https://stackoverflow.com/questions/59910185/deadlock-when-combining-python-with-tbb
Complete test case: https://github.com/dmikushin/python_tbb
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the complete test case at github.com/dmikushin/python_tbb and the linked Stack Overflow question. Trace the Python callback from the multithreaded TBB context, focusing on the gil_scoped_acquire and gil_scoped_release interaction. Done means reproducing the deadlock, identifying its cause, and demonstrating a fix with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100