Embedded Threading Question
Tim Dietz
tpdietz at hotmail.com
Wed Dec 4 10:38:46 EST 2002
hansgeunsmeyer at earthlink.net (hg) wrote in message news:<95959723.0212031758.7711af8f at posting.google.com>...
> tpdietz at hotmail.com (Tim Dietz) wrote in message news:<32355ee1.0212021558.8f7d766 at posting.google.com>...
> > > Tim Dietz wrote:
>
> > actually, the thread works very well, until I try to call a C
> > function from Python. That's when the application hangs. If
> > I do not try to interact with C from this new Python thread,
> > the application is happy. I can call these same C functions
> > from the main thread in Python, but not from a thread other than
> > main. I am using python22.dll.
>
> How are you calling these C functions? Do the C functions call back into Python
> (or do they have access to variables in your embedded Python app)?
>
> Hans
Using SWIG, we create a Python module and a C++ wrapper class. The Python
module then has a class Foo, which we use to call methods that interface
into the C++ Foo class. So, in Python, I call Foo.SetValue(val) and the
SetValue() method of the C++ Foo class is called.
Does that help to explain things better?
Tim
More information about the Python-list
mailing list