title: apply_assync() executes lines outside the function
body: <p>I have a code:</p>
  
  <pre><code>            import multiprocessing as mp
              import time
  
              sym=[1,2,3,4,5,6,7,8,9,10]
              print "AAAAAAAAAAAAAAAAAAAAAAAAAAA"
              def test(c):
                  print c
              gjd=0
              if __name__ == '__main__':
                      if float(gjd)&lt;((time.time()/60)):
                          gjd=float(int(time.time() / 60) + 1)
                          zxc=time.time()
                          p = mp.Pool(processes=7)
                          for t in sym:
                              p.apply_async(test, args=(t,))
                          time.sleep(0.6)
                          p.close()
                          p.join()
                          print '----------------------------',time.time()-zxc,'----------------------------'
  </code></pre>
  
  <p>However, I do not truly understand why the line</p>
  
  <pre><code>        print "AAAAAAAAAAAAAAAAAAAAAAAAAAA"
  </code></pre>
  
  <p>was executed 7 times prior to the amount of worker defined at </p>
  
  <pre><code>                    p = mp.Pool(processes=7)
  </code></pre>
  
  <p>The output of my code is:</p>
  
  <pre><code>            AAAAAAAAAAAAAAAAAAAAAAAAAAA
              AAAAAAAAAAAAAAAAAAAAAAAAAAA
              AAAAAAAAAAAAAAAAAAAAAAAAAAA
              AAAAAAAAAAAAAAAAAAAAAAAAAAA
              AAAAAAAAAAAAAAAAAAAAAAAAAAA
              1
              2
              3
              4
              5
              6
              7
              8
              9
              10
              AAAAAAAAAAAAAAAAAAAAAAAAAAA
              AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
              A
              ---------------------------- 0.858999967575 ----------------------------
  
              Process finished with exit code 0
  </code></pre>
  
  <p>How can I prevent the executions of lines outside of the function called at my multiprocessing pool?</p>