message processing/threads

Aahz aahz at pythoncraft.com
Sat Feb 17 16:25:28 EST 2007


In article <mailman.3886.1171258250.32031.python-list at python.org>,
Jonathan Curran  <jonc at icicled.net> wrote:
>
>I need a program running in the background to process messages (FIFO order) 
>which I would send using soap/xmlrpc/pyro (haven't decided yet). According to 
>my thinking I would need to make this a threaded application. One thread to 
>process the messages and the other thread(s) would be used to listen for 
>messages and insert it into the message queue.
>
>Is my thinking correct? Is there a better way to do such a thing?

Well, that's one option.  Your other two options are to implent your
program with multiple processes or to use event-loop programming.  Your
basic design looks reasonably sound, though you might consider multiple
threads to process messages (which probably won't provide any performance
boost but could enhance response if you're using callbacks at all).
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I disrespectfully agree."  --SJM



More information about the Python-list mailing list