title: control python code to run on different core
body: <p>I have ubuntu OS on my machine that has 4 cores. Also, I have a python script called python.py that has different functions such as def1, def2, and def 3.
  I would like to run def1 on core 1 , and the rest on core 2 to 4.
  I know that I can use:</p>
  
  <pre><code>       #taskset -c 1 python.py 
  </code></pre>
  
  <p>The problem with this makes the whole script run on one core for each function inside it. however, I want to run specific function on specific core such as:</p>
  
  <pre><code>       def add(a,b):
             return a+b
  
         def sub(s, t):
             return s-t
  
         def mult(y,x):
             return y*x
  
        add(3,4)  # run this function on core 0
        sub(3,4)  # run this function on core 1
        mult(2,3)  # I don't core run on core 2 or 3
  </code></pre>
  
  <p>My question is: Is This Possible?  </p>