My ultimate goal is to write a multi-threaded c++ program where each class will be run in its own thread, and some of these classes need to call python functions. Ideally the classes which call Python would be self-contained i.e. interpreter initialization etc. would be taken care of in each class individually.
While researching pybind11 and Boost.Python, I found initializing/finalizing the interpreter multiple times can lead to problems. CPython seemed like the only solution to this problem, but then I saw this post which showed a Cython function which did not require the interpreter to be initialized.
Is it only functions which have a direct C translation like in this post that do not need to initialize the Python interpreter? How about Python functions which use numpy and opencv? (I am trying to write my own test program but that's for another question).