cbarrick / evo

Evolutionary Algorithms in Go
GNU General Public License v3.0
113 stars 5 forks source link

Race condition in graph population #1

Closed cbarrick closed 9 years ago

cbarrick commented 9 years ago

The graph population may close a genome before it's done using it.

Genomes are closed when the inner-loop of the containing node is complete and a new genome is set to replace the contents. However, the genome may be used by neighboring nodes in their inner-loop. To fix this, we need to keep up with the references to the genome and delay closing until the reference count is 0.

The work around is to not rely on the close method of genomes it you rely on the graph population. This prohibits certain optimizations, like recycling genomes. Fixing this is high priority.

cbarrick commented 9 years ago

Fixed by cc5c800