On Thu, Nov 10, 2016 at 10:03 PM, <mspauldin...@gmail.com> wrote: > > I've written a small program to demonstrate what I am seeing. If I use a > channel as a semaphore and set the size of the channel to 1, I would expect > that the executions of my handle function below would all be executed in > order, but it's not. For some reason the last item in the list is always > handled first, and then the remaining items are handled in order. Does > anyone know why I see this behavior?
There is no relationship between the different goroutines started by your program. In effect they are all started simultaneously. They can start running in any order. The specific order you happen to see will depend on the number of CPUs on your system and how fast it is. Ian -- 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. For more options, visit https://groups.google.com/d/optout.