Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for x in xrange(100,14000):
- for y in xrange(0,3000):
- for z in xrange(0,700):
- operationg_tag = "%s-%s-%s" % (x,y,z)
- operation_code = ....
- and more bunch of code is running here on the tag generated above
- def func(start, final):
- for x in xrange(start, final):
- for y in xrange(0,3000):
- for z in xrange(0,700):
- operationg_tag = "%s-%s-%s" % (x,y,z)
- operation_code = ....
- def main():
- total = 14000
- div_total = int(14000 / 3)
- rest_div_total = 14000%3
- t1 = multiprocessing.Process(target = func,name = "", args=(100, div_total)
- t2 = multiprocessing.Process(target = func,name = "", args=(div_total, div_total*2)
- t3 = multiprocessing.Process(target = func,name = "", args=(div_total*2, div_total*3 + rest_div_total + 1)
- list_threads = [t1,t2,t3]
- for i in list_threads:
- i.start()
- for i in list_threads:
- i.join()
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment