When is PyEval_InitThreads meant to be called? [duplicate]
This question already has answers here : PyEval_InitThreads in Python 3: How/when to call it? (the saga continues ad nauseam) (7 answers) Closed 6 years ago . I'm a bit confused about when I'm supposed to call PyEval_InitThreads . In general, I understand that PyEval_InitThreads must be called whenever a non-Python thread (i.e. a thread that is spawned within an extension module) is used. However, I'm confused if PyEval_InitThreads is for C programs which embed the Python interpreter, or Python programs which import C-extension modules, or both. So, if I write a C extension module that will