Newbie: Running two threads...

  • Thread starter Siddharth Choudhuri
  • Start date
S

Siddharth Choudhuri

I am trying to come up with an app that reads data out of socket
(concurrent server) and display a graph on the UI. I have one program that
uses asyncore.loop() to read data out of a port. The second program uses
Tkinter to have the UI and uses mainloop() to respond to mouse-click and
other events.

Now, the problem is how do I combine the two ? since there are two event
loops. If I put the asyncore.loop() within the UI, the code blocks waiting
for input and does not update the UI.

TIA
-siddharth

_____________________________________________________________________
Unix is user friendly - its just picky about its friends.
_____________________________________________________________________
 
A

anton muhin

Siddharth said:
I am trying to come up with an app that reads data out of socket
(concurrent server) and display a graph on the UI. I have one program that
uses asyncore.loop() to read data out of a port. The second program uses
Tkinter to have the UI and uses mainloop() to respond to mouse-click and
other events.

Now, the problem is how do I combine the two ? since there are two event
loops. If I put the asyncore.loop() within the UI, the code blocks waiting
for input and does not update the UI.

TIA
-siddharth

_____________________________________________________________________
Unix is user friendly - its just picky about its friends.
_____________________________________________________________________
IMHO standard solution is to use Queue---socket process polpulates a
queue and UI pulls data from it.

regards,
anton.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,938
Members
47,474
Latest member
VivianStuk

Latest Threads

Top