Python, Tkinter, and Threading

Aahz aahz at pythoncraft.com
Sat Feb 22 19:11:25 EST 2003


In article <PBicnbvaspwWOMyjXTWcqA at comcast.com>,
Marc <losnations at comcast.net> wrote:
>
>Nothing special really. I have several applications that all do
>different things. Most interface with test equipment and manipulate
>them in various ways. The user inputs the data and input files and the
>program goes off and does it's business with status fed back to the
>gui. Of course in order to maintain control and update the gui, all of
>these subordinate tasks need to be spun off in separate processes to
>share time with the main gui thread.  Otherwise, the gui won't update
>until the very end.
>
>Using the queue model, some of these tasks are fairly difficult to
>execute.  I haven't found any way yet to input any type of decision
>making into a queue. So any type of decision making must be fed into
>functions that are called from within the queue. This works will in
>some cases, but can be difficult to balance the real-time execution,
>which the equipment depends on, with the queue functionality which
>will always lag a bit. Therefore, I have split most of my functions
>into bite size chunks that handle a little at a time, but it is still
>cumbersome and difficult to get the timing down correctly.

What kind of decision-making are you talking about?  Can you give an
example?  Sounds to me like you have three different issues going on
here: GUI, processing, and real-time control.  Trying to do all of this
in a single process, even with multi-threading, probably won't work all
that well.  You might look into Twisted's multi-processing capabilities.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Register for PyCon now!  http://www.python.org/pycon/reg.html




More information about the Python-list mailing list