Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
https://ale.farama.org/
GNU General Public License v2.0
2.18k stars 424 forks source link

ALE_python_interface stuck when running simutaneously in multiple threads #156

Closed peterzcc closed 8 years ago

peterzcc commented 8 years ago

I'm trying to run 16 ALE_python_interface instances in parallel and run the games simultaneously using concurrent.futures.ProcessPoolExecutor.map

However, I got stuck when calling ale.act(action) in the subprocesses.

It takes 0.27 seconds to run 16 ALE instances sequentially, which is too long.

Could anyone help to make some suggestions? Thanks!

mgbellemare commented 8 years ago

Hi,

What do you mean by "got stuck", exactly? There shouldn't be any locking involved here.

Also, ALE is close to, but possibly not quite thread-safe.

Cheers,

On Wed, Mar 30, 2016 at 9:14 AM, peterzcc notifications@github.com wrote:

I'm trying to run 16 ALE_python_interface instances in parallel and run the games simultaneously using concurrent.futures.ProcessPoolExecutor.map

However, I got stuck when calling ale.act(action) in the subprocesses.

It takes 0.27 seconds to run 16 ALE instances sequentially, which is too long.

Could anyone help to make some suggestions? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mgbellemare/Arcade-Learning-Environment/issues/156

peterzcc commented 8 years ago

Hi Marc,

Thanks for your comment. I solved the issue using concurrent.futures.ThreadPoolExecutor.

Cheers, Peter