zloop1982 / bwapi

Automatically exported from code.google.com/p/bwapi
0 stars 0 forks source link

Support multithreading #470

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is both a feature request and a bug fix.  BWAPI isn't thread safe which is 
understandable but calling getAllUnits() shouldn't cause heap corruption in the 
destructor of Vectorset....

The following will fail often:

Unitset set = Broodwar->getAllUnits();

The following is a fix around it:

Playerset players = Broodwar->getPlayers();

for (Playerset::iterator it = players.begin();it != players.end();it++)
{
  Player* player = *it;
  Unitset units = player->getUnits();

  ... whatever you need to do with the units ...
}

Original issue reported on code.google.com by pawngam...@gmail.com on 9 Oct 2012 at 8:28

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 6 Jan 2013 at 4:44

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 6 Jan 2013 at 4:51

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 7 Jan 2013 at 3:47

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 16 Mar 2013 at 4:54

GoogleCodeExporter commented 9 years ago
I've decided that BWAPI will not support multi-threading.

Original comment by AHeinerm on 13 Aug 2013 at 3:22