How to force a thread to stop

Paul Rubin http
Wed Jul 26 16:47:51 EDT 2006


"Carl J. Van Arsdall" <cvanarsdall at mvista.com> writes:
> Alright, so manually running builds is going to be crazy and
> unmanageable.  So what the people who came before me did to manage
> this scenario was to fork on thread per build.  The threads invoke a
> series of calls that look like
> 
> os.system(ssh <host> <command>)

Instead of using os.system, maybe you want to use one of the popens or
the subprocess module.  For each ssh, you'd spawn off a process that
does the ssh and communicates back to the control process through a
set of file descriptors (Unix pipe endpoints or whatever).  The
control process could use either threads or polling/select to talk to
the pipes and keep track of what the subprocesses were doing.

I don't think you need anything as complex as shared memory for this.
You're just writing a special purpose chat server.



More information about the Python-list mailing list