title: How to process many text files in array of threads c#
body: <p>There is a directory with some text files which i need to process in some way.
  There are 4 threads.
  How to process this text files in array of threads?
  Any thoughts?</p>
  
  <pre><code>int countfiles; //count of files
      int countthreads = 4;
      Thread[] threads = new Thread[countthreads];
      Queue&lt;string&gt; filesqueue = new Queue&lt;string&gt;();
      foreach (string file_to_read in filelist)
      {
          filesqueue.Enqueue(file_to_read); //добавить в очередь файлы из каталога
          countfiles++;
      }
      for (int i = 0; i &lt; countthreads; i++)
      {
          //how to process text files in array of threads
  
      }
  </code></pre>