magawake at gmail.com
Fri Sep 11 01:31:07 CEST 2009
Currently, I am using a bash script to ssh into 400 servers and get an
output, ie check if a file exists on a local filesystem. I am doing
this linearly, however I am interesting in doing this with threads and
more important using Python standard threading library.
My pseudo code would be something like this:
Have a list of the servers in a dictionary
Create the number of threads which correspond to servers. ie 400 threads
Each thread will spawn ssh and execute the file test
Once all threads are completed, I send a signal saying "all is one",
and it will create some sort of output.
Is there a better way of doing this? My goal is to learn python and
threading, I know this is a silly example but its worth a try :-)
More information about the Python-list