A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-December/130791.html below:

[Python-Dev] thread issues when embedding Python

[Python-Dev] thread issues when embedding Python [Python-Dev] thread issues when embedding PythonChris Angelico rosuav at gmail.com
Wed Dec 18 16:02:23 CET 2013
On Wed, Dec 18, 2013 at 9:26 PM, Daniel Pocock <daniel at pocock.com.au> wrote:
> b) when each worker thread starts, call
> PyThreadState_New(mInterpreterState)  and save the result in a thread
> local mPyThreadState
>
> c) use the mPyThreadState with PyEval_RestoreThread and
> PyEval_SaveThread before and after calling Python methods
>
> Is this a bug in PyGILState_Ensure or is it a deficiency in the
> documentation?

It doesn't surprise me that you would need to do step b - I do seem to
recall the need to call that for each new thread. Not so sure about c.
Once you fixed the unrelated bug, do you still need that step? (Been a
while since I last embedded Python though, and I might well be wrong.)

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4