how to start a new thread from a GUI

Graham Ashton graz at mindless.com
Fri Aug 17 09:42:45 CEST 2001


In article <D71f7.123070$g_3.18618906 at typhoon.austin.rr.com>, "Wen Jiang"
<wjiang71 at yahoo.com> wrote:

> so the worker program would be able to run at background even the X
> session is done.I have the worker class method runable as a standalone
> program before I got the GUI anyway. The GUI could then be restarted
> later to probe for the progress and intermediate results from the log
> files.

Why not make it a daemon that runs continuously in the background,
servicing requests from clients. Making a process into a daemon on Unix
is really quite easy.

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012

If you made the client and server talk to each other via something like
XML-RPC then you could even put your daemon on a different machine if you
wanted, allowing clients to connect over the network and farm jobs out to
a server.

  http://www.onlamp.com/pub/a/python/2000/11/22/xmlrpcclient.html

With RPC you can execute procedures, or methods, on remote systems. So
you'd have one RPC method to start the processing job, and one to
retrieve the status of the job or the final answer.

HTH.

--
Graham



More information about the Python-list mailing list