ikostrikov / pytorch-a3c

PyTorch implementation of Asynchronous Advantage Actor Critic (A3C) from "Asynchronous Methods for Deep Reinforcement Learning".
MIT License
1.23k stars 279 forks source link

Multi-processing or multi-threading #64

Open lingzhang0319 opened 5 years ago

lingzhang0319 commented 5 years ago

Hi,

In the original paper, it mentions that it uses multi threads. But I see in your code, you are using multi-process. As far as I know, these two methods are actually different. Could you explain whether these two methods make a difference or which way is better?

Thanks!

UesugiErii commented 5 years ago

@lingzhang0319 Multi-processing is better.In Python,since there is a GIL(Global Interpreter Lock),multi threads cant use multi cpu cores,but multi-processing can. As to original paper,I dont know why use multi threads , maybe since threads programing is easy.