On Thu, Dec 6, 2018 at 4:40 PM Alex Dvoretskiy <advoretski...@gmail.com> wrote:
>
> Hi Golangnuts,
>
> I'm trying to run SignerCrc32() concurently, but instead it runs 
> sequentially. Can you explain why?

You are running it concurrently, but you're waiting for the result to arrive.

SignerCrc32 runs in a separate goroutine. It takes it 1 second to
return the result. During that time, the Worker for loop is waiting to
read from tmpChan. When SignerCrc32 returns, the result is written to
tmpChan, for loop iterates once, creates another goroutine, and starts
waiting to read from tmpChan again, which will come in one second.




>
> https://play.golang.org/p/l5A3tBSqfs1
>
> --
> 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.

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

Reply via email to