[go-nuts] Re: Concurrency and order of execution

2016-11-15 Thread steve tang
There is not any guarentee in your goroutine, But you could try it as:https://play.golang.org/p/JDRAP4mxdc On Friday, November 11, 2016 at 2:08:39 PM UTC+8, mspaul...@gmail.com wrote: > > Hello, > > I've written a small program to demonstrate what I am seeing. If I use a > channel as a semap

[go-nuts] Re: Concurrency and order of execution

2016-11-11 Thread mspaulding06
Okay, that makes sense. I've updated my solution so that in the case that the channel only has a capacity of 1 the processing will be done without goroutines to ensure that it is done in serial. In the case that the channel capacity is larger then I don't care about how processing is ordered.

[go-nuts] Re: Concurrency and order of execution

2016-11-10 Thread Dave Cheney
The runtime does not give any guarentee when you use a go statement if the goroutine being spawned will run immediately, or if control will remain with the original goroutine. This program, https://play.golang.org/p/-OcCzgt4Jy, which pauses all goroutines while they are being created exhibits