News for hackers. Stuff that matters.
Re:Cohabitation with Python and C++ by ephelon on Thursday November 24, 2011 @09:06PM (#3275967)
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...

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

Re:Cohabitation with Python and C++ by swah on Thursday November 24, 2011 @04:20PM (#3275442)
When you say HTTP API, does that mean you had C++ http server, C++ http client, Python http server and Python http client?
Re:Cohabitation with Python and C++ by benhoyt on Thursday November 24, 2011 @05:14PM (#3275545)
Good question: In this case C++ was the server, and Python (via urllib2) was the client.
Re:Cohabitation with Python and C++ by rikthevik on Thursday November 24, 2011 @06:24PM (#3275714)
Out of curiosity, why didn't you fork and use a pipe?
Re:Cohabitation with Python and C++ by benhoyt on Thursday November 24, 2011 @08:32PM (#3275911)
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.
Re:Cohabitation with Python and C++ by swah on Thursday November 24, 2011 @05:16PM (#3275552)
Thanks.