threading question

M

Mag Gam

Hello,

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 :)

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top