[omniORB] Using omniORB for communication between C++ and Embedded Python
Duncan Grisby
duncan@grisby.org
Wed Jul 24 14:33:00 2002
On Tuesday 23 July, "Kevin Wooten" wrote:
> What I am doing in script is: Implementing the IDL interface,
> initializing the ORB then creating a stringified IOR and saving it
> in a variable. From C++ I compile this script get the stringified
> IOR from a Python variable and use ORB::string_to_object to create a
> reference; all of this appears to work just fine. When I issue a
> request on the reference it always hangs.
What you are trying to do should work fine. Almost certainly the
problem is that you are holding the Python global interpreter lock, so
you're deadlocking as you try to re-enter Python. You should read the
Python C Embedding tutorial section about the interpreter lock.
If you are using omniORBpy 2, you can look at the examples/embed
directory that contains an example doing what you want. omniORB 4 /
omniORBpy 2 have two advantages over omniORB 3 / omniORBpy 1. First,
the communication between C++ and Python is much much faster; second,
there is a C++ API that directly converts object references from one
to the other, without involving stringified IORs.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan@grisby.org --
-- http://www.grisby.org --