title: Running Python on multiple cores
body: <p>I have created a (rather large) program that takes quite a long time to finish, and I started looking into ways to speed up the program.</p>
  
  <p>I found that if I open task manager while the program is running only one core is being used.</p>
  
  <p>After some research, I found this website: 
  <a href="https://stackoverflow.com/questions/15639779/why-does-multiprocessing-use-only-a-single-core-after-i-import-numpy">Why does multiprocessing use only a single core after I import numpy?</a> which gives a solution of <code>os.system("taskset -p 0xff %d" % os.getpid())</code>, 
  however this doesn't work for me, and my program continues to run on a single core.</p>
  
  <p>I then found this: 
  <a href="https://stackoverflow.com/questions/7542957/is-python-capable-of-running-on-multiple-cores">is python capable of running on multiple cores?</a>, 
  which pointed towards using multiprocessing.</p>
  
  <p>So after looking into multiprocessing, I came across this documentary on how to use it <a href="https://docs.python.org/3/library/multiprocessing.html#examples" rel="noreferrer">https://docs.python.org/3/library/multiprocessing.html#examples</a></p>
  
  <p>I tried the code:</p>
  
  <pre><code>from multiprocessing import Process
  
  def f(name):
      print('hello', name)
  
  if __name__ == '__main__':
      p = Process(target=f, args=('bob',))
      p.start()
      p.join()
  
  a = input("Finished")
  </code></pre>
  
  <p>After running the code (not in IDLE) It said this: </p>
  
  <pre><code>Finished
  hello bob
  Finished
  </code></pre>
  
  <p>Note: after it said Finished the first time I pressed enter</p>
  
  <p>So after this I am now even more confused and I have two questions</p>
  
  <p>First: It still doesn't run with multiple cores (I have an 8 core Intel i7)</p>
  
  <p>Second: Why does it input "Finished" before its even run the if statement code (and it's not even finished yet!)</p>