callbacks and threading

KP <[email protected]> Fri, 19 Aug 2016 17:44:03 -0400
Newsgroups gmane.comp.python.ctypes
Message-ID <CANaFf5Oc9LDHov_uQsP-sJ4YmP3_7BdRKNgzOrOi0doZ6as7uQ@mail.gmail.com>
I have a python client with ctypes wrappers to call in to a DLL that in
turn talks to a server process. One of the features is to register a
callback on an event. I am able to successfully register callbacks, and
they do get called on events...so all is working well there.

However, it seems the callbacks are always executed in the "main"
thread...even when I know there are other commands running in the main
thread.

I'm not entirely sure how this happens/or is possible.  The main thread is
running a loop, but the callback also reports being in the main thread (by
printing threading.currentThread()). Is this something ctypes has control
over that I can tweak?

I need it to be in a different thread so that any CTRL-C will _not_ end up
in that thread, and will instead impact the main thread...er, well, what I
am thinking of as the main thread (not the callback).

Any ideas? Thanks,
Kevin

------------------------------------------------------------------------------

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users