title: Call function in 5 different thread and execute in parallel in Python 2.7
body: <p>This is the first time I am using the multithreading in python.
  I found many documents in related to multithread and multi-processing in python 2.7.9 and researched also <a href="https://stackoverflow.com/questions/8241099/executing-tasks-in-parallel-in-python">multi-threading link</a>. But I didn't get clue how to implement my application.  I am having application based on self.count, which is in the below code is 5. I have to create a 5 threads or process and when I call d.sum(1,2) This should <strong>call sum function in 5 different thread</strong> and execute in parallel and <strong>update the result in result dictionary with thread-name and result</strong>.</p>
  
  <p>Now my current approach is happening serially. <strong>But I want to make this as parallel using thread or process</strong>. Please help in achieving this.</p>
  
  <p>Thanks in  advance. The code snippets are highly appreciated.</p>
  
  <p>I have the code so far.</p>
  
  <pre><code>class Base(object):
  
      def __init__(self): 
          self.count =5  # Count = 5 is used to create a 
                         #number of thread or process to run parallel
  
      def sum(self, a, b):
          result = {}
          for i in range(0,self.count):
              result[i] = a + b
  
          return result
  
      def diff(self, a, b):
          result = {}
          for i in range(0,self.count):
              result[i] = a - b
  
          return result
  
      def mull(self, a, b):
          result = {}
          for i in range(0,self.count):
              result[i] = a * b
  
          return result
  
      def division(self, a, b):
          result = {}
          for i in range(0,self.count):
              result[i] = a / b
          return result
  
  d = Base() 
  print d.sum(1,2)
  print d.diff(2,1)
  </code></pre>