When adding a new candidate if the bin does not exist it will be added as empty. If another thread is in logging (archive synchronized) it might pull the empty bin in methods that cannot deal with that and this can stall the program. This only happens when a new bin is made. If the whole add method is archive synchronized it seems to fix the issue. If you add the new bin right before replacing the bin within a synchronized(archive) it seems to fix the issue (ran 10 times without issue). If you do that with synchronized(this) it does not fix the issue.
Attempting to fix by having conditional statements related to subpopInBin assignment, adding the new bin right before replacement, and using synchronized(archive).
When adding a new candidate if the bin does not exist it will be added as empty. If another thread is in logging (archive synchronized) it might pull the empty bin in methods that cannot deal with that and this can stall the program. This only happens when a new bin is made. If the whole add method is archive synchronized it seems to fix the issue. If you add the new bin right before replacing the bin within a
synchronized(archive)it seems to fix the issue (ran 10 times without issue). If you do that withsynchronized(this)it does not fix the issue.Attempting to fix by having conditional statements related to
subpopInBinassignment, adding the new bin right before replacement, and usingsynchronized(archive).