How to force a thread to stop

Carl J. Van Arsdall cvanarsdall at mvista.com
Wed Jul 26 18:08:44 EDT 2006


Paul Rubin wrote:
> "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.
>   
Sorry for sounding naive, but how is writing a chat server less complex 
then letting python handle shared memory while I manage a couple of 
locks?  Also, threading's condition and event constructs are used a lot 
(i talk about it somewhere in that thing I wrote).  They are easy to use 
and nice and ready for me, with a server wouldn't I have to have things 
poll/wait for messages?

-c

-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list