in reply to Inconsistent results with keys on thread shared hashes

Locks arent all ....Use an array? Here is food for thought Re^8: Multithreading, how to? ...
  • Comment on Re: Inconsistent results with keys on thread shared hashes

Replies are listed 'Best First'.
Re^2: Inconsistent results with keys on thread shared hashes
by izomiac (Novice) on Aug 03, 2022 at 19:12 UTC
    In this instance an array would be the better choice. I chose to complicate a simple part of my code to make a more complex part simpler. While I was debugging this glitch in my code I refactored and reimplemented the genetic sorting algorithm many times, and the current iteration uses a similar technique to what you linked (albeit they did it better, making me wish I'd seen that post earlier). It got to the point that I was absolutely confident that part of the code wasn't the problem, so I started recording the output from my simpler subroutines to track down where the inconsistencies were being generated. I will say, genetic sorting doesn't work all that great when your value function gives different results for the same input.