pybind / pybind/pybind11

TBB deadlocks pybind11 app due to mistreatment of GIL

Open
#2,093 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.