Hallöchen! Jan Mercl writes:
> [...] > > From https://go.dev/ref/spec#Select_statements > > """" > 2. If one or more of the communications can proceed, a single one that > can proceed is chosen via a uniform pseudo-random selection. > """" > > Selecting the send case in the above code, when both cases can > proceed, for N times in a row, should have on average a probability of > 2^(-N). I agree with that as long as DoSomething exists with error quickly in case of a cancellation, so that we can be sure that the context is still active at the beginning of the select statement. So this example is correct. But would you agree that additional checking is necessary if DoSomething does not have a ctx argument? Regards, Torsten. -- Torsten Bronger -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/874jtrlih4.fsf%40physik.rwth-aachen.de.