How to force a thread to stop
Paul Rubin
http
Thu Jul 27 03:14:54 EDT 2006
Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
> Ugh... Seems to me it would be better to find some Python library
> for SSH, something similar to telnetlib, rather than doing an
> os.system() per command line. EACH of those os.system() calls probably
> causes a full fork() operation on Linux/UNIX, and the equivalent on
> Windows (along with loading a command shell interpreter to handle the
> actual statement).
I think Carl is using Linux, so the awful overhead of process creation
in Windows doesn't apply. Forking in Linux isn't that big a deal.
os.system() usually forks a shell, and the shell forks the actual
command, but even two forks per ssh is no big deal. The Apache web
server usually runs with a few hundred processes, etc. Carl, just how
many of these ssh's do you need active at once? If it's a few hundred
or less, I just wouldn't worry about these optimizations you're asking
about.
More information about the Python-list
mailing list