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
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.
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