GA3C icon indicating copy to clipboard operation
GA3C copied to clipboard

Why the ProcessAgent use Process while the ThreadTrainer use Thread?

Open tangbohu opened this issue 7 years ago • 2 comments

Hello!

Why the ProcessAgent use Process while the ThreadTrainer use Thread? I wonder whether the ProcessAgent.py could use Thread instead of Process

tangbohu avatar Jul 05 '18 03:07 tangbohu

I have the same question. Is it because the efficiency of data transform in Queue between processes?

boluoweifenda avatar Sep 01 '18 02:09 boluoweifenda

I might figure out the reason after reimplementing this project. Since the trainers and predictors have the same tensorflow model and parameters, and it's hard/inefficient to share them by Queue in multiprocess class. Although in Python the multithread class cannot use multi-core due to GIL, the trainer and predictors are usually using the same GPU, so the bottleneck happens in GPU computation rather than in the multithread trainers and predictors in the main process.

boluoweifenda avatar Aug 27 '19 09:08 boluoweifenda