afknst / gxb2_battle_simulator

Battle simulator for GxB2
GNU General Public License v3.0
0 stars 0 forks source link

Multiple processing #6

Closed darengithub closed 2 years ago

darengithub commented 2 years ago

The running for a single battle even looks time consuming. Perallel runs is needed to leverage idle resource.

This is CPU bound usage, multithreading may won't help. So the way is to go multi-processing.

I'd like to look into that. 1 look the lua multi-process supporting. 2 if lua mp supporting is bad, will seek to add a python wrapper.

afknst commented 2 years ago

Currently, what I usually do is run several terminals at the same time to speed it up.

The problem with using Lua is that it doesn't support multithreading/multiprocessing natively so we have to introduce external dependencies if we want those features.

I considered writing a Python or C wrapper but didn't have time so your work could be helpful xD

afknst commented 2 years ago

An Python example using Pexpect: d54a601

darengithub commented 2 years ago

0001-multiple-process-support.patch.gz

It's the proposed patch, use gunzip to decompress. And please review.

afknst commented 2 years ago

Good job! I think you can create a new branch if you want to maintain this version. I'd continue to work on the current version since I prefer my implementation.

darengithub commented 2 years ago

Sure. My version is committed to the new branch of "daren_multiprocess".