Multi-threaded wrapping

Rob McDonald <[email protected]> Mon, 12 Sep 2022 10:54:48 -0700
Newsgroups gmane.comp.programming.swig
Message-ID <CAEppYpHWirfq30dSBvEz-xRmhuxFDmk6Rvki9ky-0p0XqBC=2Q@mail.gmail.com>
I have a C++ application with an event driven GUI (using FLTK) that is
currently wrapped with Swig for Python.

I can make calls (with no GUI loaded) to the exposed API.  I can also
launch the GUI from Python (and FLTK event loop) and interact with the
graphical program for a while -- when satisfied, I can terminate the event
loop to return control to Python.

I would like to be able to leave the application GUI active (event loop
still running) and return control to Python.  The Python side might
actually be a separate GUI with its own event loop.  The two loops will
need to communicate occasionally -- I can likely initiate all communication
from the Python side.

I believe I will need to run Swig with the 'threads' option.  I also need
to set up some sort of lock so the C++ event loop pauses when the C++ API
is responding to a request from the Python side.

Can anyone give any pointers on how to achieve this?  Are there any
examples of this available online?

Thanks in advance,

Rob

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user