title: Python multicore programming
body: <p>Please consider a class as follow:</p>
  
  <pre><code>class Foo:
      def __init__(self, data):
          self.data = data
  
      def do_task(self):
          #do something with data 
  </code></pre>
  
  <p>In my application I've a list containing several instances of Foo class. The aim is to execute <code>do_task</code> for all Foo objects. A first implementation is simply:</p>
  
  <pre><code> #execute tasks of all Foo Object instantiated
   for f_obj in my_foo_obj_list:
       f_obj.do_task()
  </code></pre>
  
  <p>I'd like to take advantage of multi-core architecture sharing the <code>for</code> cycle between 4 CPUs of my machine.</p>
  
  <p>What's the best way to do it?</p>