title: Multiple concurrent SFTP connections in python
body: <p>My goal is to concurrently fetch files from multiple servers including multiple files from the same server. I am given a dict of file paths to fetch. </p>
  
  <p>I'm thinking of something like this: <a href="https://stackoverflow.com/questions/3485428/creating-multiple-ssh-connections-at-a-time-using-paramiko">paramiko multi ssh</a> but with SFTP.</p>
  
  <p>I have a list of opened <code>pysftp.Connection</code> objects. I can reuse these connection handles, so at least if I need to interact with the same server, the initialization process is skipped. I've been using this without errors. When I use <code>threading</code> for invoking the function that fetches the files however, it stops working, because multiple threads are trying to take over the same SFTP connection which is not supported by <code>pysftp</code>.</p>
  
  <p>Do you know any workaround for this?</p>