Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- β cat test.py
- #!/usr/bin/env python2.7
- import multiprocessing
- import time
- import sys
- def task(index):
- for i in range(0, 100):
- sys.stdout.write('='.join([str(index)] * 10) + '\n')
- time.sleep(0.001 * index)
- if __name__ == '__main__':
- pool = multiprocessing.Pool(8)
- pool.map(task, range(0,100))
- pool.close()
- pool.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement