How could I ask Thread B to call B().Method() from inside Thread A's run?

How could I ask Thread B to call B().Method() from inside Thread A's run?

Post by NavyJa » Fri, 02 Dec 2005 02:30:23


I agree with jmj's solution, you would want to send a signal of some
sort to Thread B from A when some event occurs in A. A queue is one
way to do it, but keep in mind that there are numerous ways to
communicate between threads/processes (queue, pipe, exit status,
TCP/UDP message, etc.). I believe one of the first couple chapters in
O'Reilly's "Programming Python" book discusses most of these methods.
Choose the simplest one that meets your needs.