Guest User

Untitled

a guest
May 24th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. for x in xrange(100,14000):
  2. for y in xrange(0,3000):
  3. for z in xrange(0,700):
  4. operationg_tag = "%s-%s-%s" % (x,y,z)
  5. operation_code = ....
  6.  
  7. and more bunch of code is running here on the tag generated above
  8.  
  9. def func(start, final):
  10. for x in xrange(start, final):
  11. for y in xrange(0,3000):
  12. for z in xrange(0,700):
  13. operationg_tag = "%s-%s-%s" % (x,y,z)
  14. operation_code = ....
  15. def main():
  16. total = 14000
  17. div_total = int(14000 / 3)
  18. rest_div_total = 14000%3
  19. t1 = multiprocessing.Process(target = func,name = "", args=(100, div_total)
  20. t2 = multiprocessing.Process(target = func,name = "", args=(div_total, div_total*2)
  21. t3 = multiprocessing.Process(target = func,name = "", args=(div_total*2, div_total*3 + rest_div_total + 1)
  22. list_threads = [t1,t2,t3]
  23. for i in list_threads:
  24. i.start()
  25. for i in list_threads:
  26. i.join()
  27.  
  28. if __name__ == "__main__":
  29. main()
Add Comment
Please, Sign In to add comment