|
|
|
|
|
by tapirl
1600 days ago
|
|
> > user code could simulate non-deterministic > I'm curious how? if rand.Intn(2) == 0 {
select {
case: <-chan2_whichItreatTheSameAsChan3 // a higher priority
case: 0xFF ->chan3_whichItreatTheSameAsChan2
}
} else {
select {
case: 0xFF ->chan3_whichItreatTheSameAsChan2 // a higher priority
case: <-chan2_whichItreatTheSameAsChan3
}
}
Yes, it increases verbosity to the other way, but no performance loss. |
|