This repository has been archived by the owner on May 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The o+i*p approach to visiting select cases in random order stops being fair when there is some case that is never ready. If that happens, then the case that follows it in the order gets more chances than the others. In general the only way to ensure fairness is to make all permutations equally likely. I've done that by computing one explicitly. Makes the permutations correct for n >= 4 where previously they were broken. For n > 12, there's not enough randomness to do a perfect job but this should still be much better than before. Fixes #1425. R=r, ken2, ejsherry CC=golang-dev https://golang.org/cl/4037043
- Loading branch information
Showing
1 changed file
with
30 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters