title: IronPython Multiprocessing Module
body: <p>I have some dlls written in Dotnet which I am using to access thousands of binary files. The data is compartmentalized by directories, so as a performance enhancement I thought of using multiple processes or threads to churn through the files.</p>
  
  <p>I have a function, currently part of the main class (requiring self as an argument), this could easily be refactored to a private method.</p>
  
  <p>My first inclination is to use the Multiprocess module, but that doesn't seem to be available for IronPython.</p>
  
  <p>My next thought was to use Task</p>
  
  <pre><code>def __createThreads(self):
      tasks = Array.CreateInstance(Task, 5)
      for idx in range(0, 5):
          tasks.append(Task.Factory.StartNew(self.__doWork, args=(idx,)))
  
      Task.WaitAll(tasks)
  
  def __doWork(self, idx):
  
      for index in range (0, idx):
          print "Thread: %d | Index: %d" % (idx, index)
  </code></pre>
  
  <p>Or to use Thread</p>
  
  <pre><code>def __createThreads(self):
      threads = list()
      for idx in range(0, 5):
          t = Thread(ThreadStart(self.__doWork))
          t.Start()
          threads.append(t)
  
      while len(threads) &gt; 0:
          time.sleep(.05)
          for t in threads:
              if(not t.IsAlive):
                  threads.remove(t)
  </code></pre>
  
  <p>What I cannot find is a IronPython example of how to pass arguements</p>