改为守护线程模式

This commit is contained in:
zhiyang7 2021-12-14 14:19:09 +08:00
parent 8939272955
commit 7f0e494109
1 changed files with 2 additions and 1 deletions

View File

@ -172,7 +172,7 @@ def train(flags):
actor = mp.Process(
target=act,
args=(i, device, batch_queues, models[device], flags))
# actor.setDaemon(True)
actor.daemon = True
actor.start()
actor_processes.append(actor)
@ -209,6 +209,7 @@ def train(flags):
for position in ['landlord', 'landlord_up', 'landlord_front', 'landlord_down', 'bidding']:
thread = threading.Thread(
target=batch_and_learn, name='batch-and-learn-%d' % i, args=(i,device,position,locks[device][position],position_locks[position]))
thread.setDaemon(True)
thread.start()
threads.append(thread)