title: how make this multi thread more efficient
body: <p>multithreading in python</p>
  <p>2 files</p>
  <p>messages.txt with indefinite number of lines
  keys.txt with indefinite number of lines</p>
  <p>example:</p>
  <p>keys.txt have 4 items</p>
  <p>messages.txt have 12 items</p>
  <p>my program will create 1 thread for each item on keys.txt(4 threads) calling a function with 2 items from messages.txt and so on until the message.txt file ends.</p>
  <p>example2:</p>
  <p>keys.txt have 2 items</p>
  <p>messages.txt have 6 items</p>
  <p><strong>keys.txt</strong></p>
  <blockquote>
  <p>key1 key2</p>
  </blockquote>
  <p><strong>messages.txt</strong></p>
  <blockquote>
  <p>message1 message2 message3 message4 message5 message6</p>
  </blockquote>
  <p>create 2 threads each time</p>
  <pre><code>        |message1
  THREAD1 |   --&gt; key1
          |message2
  
          |message3
  THREAD2 |   --&gt; key2
          |message4
  
  loop(60) NEED LOOP 1 MINUTE
  
          |message5
  THREAD1 |   --&gt; key1
          |message6
  </code></pre>