Results of my master's thesis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pool.py 223B

123456789101112
  1. #!/usr/bin/python
  2. from multiprocessing import Pool
  3. def f(x):
  4. return x*x
  5. if __name__ == '__main__':
  6. pool = Pool(processes = 4)
  7. result = pool.apply_async(f, (10,))
  8. print result.get()
  9. print pool.map(f, range(10))