Esempio n. 1
0
 def __init__(self, size, num_workers):
     assert size >= num_workers
     self.count = mp.Value('i', 0, lock=True)
     self.barrier = mp.Semaphore(0)
     self.num_workers = num_workers
     self.size = size
Esempio n. 2
0
 def __init__(self, size, num_workers):
     assert size >= num_workers
     self.count = multiprocessing.Value('i', 0)
     self.barrier = multiprocessing.Semaphore(0)
     self.num_workers = num_workers
     self.size = size