

Cohabitation with Python and C++ - benhoyt
http://tech.oyster.com/cohabitation-with-python-and-cpp/

======
ephelon
It's quite easy to release the GIL while you are running non-python code.[1]
Just be sure that if you touch the Python API that you reaquire the GIL.[2]

[1] [http://docs.python.org/c-api/init.html#releasing-the-gil-
fro...](http://docs.python.org/c-api/init.html#releasing-the-gil-from-
extension-code)

[2] <http://docs.python.org/c-api/init.html#PyGILState_Ensure>

------
swah
When you say HTTP API, does that mean you had C++ http server, C++ http
client, Python http server and Python http client?

~~~
benhoyt
Good question: In this case C++ was the server, and Python (via urllib2) was
the client.

~~~
rikthevik
Out of curiosity, why didn't you fork and use a pipe?

~~~
benhoyt
We're running on Windows, and fork isn't available there. Also, in this case
AFAIK fork doesn't really apply, as we wanted to start the C++ and Python
servers completely separately.

