Grokking Concurrency in Go
Vote

0% completed

​

Pipelines

Handling one page takes two steps: fetching it takes 100 ms, and parsing it takes 50 ms. Done one page after another, five pages take 5 x 150 = 750 ms. The fetch of the second page cannot start until the first page has been parsed, even though fetching page two does not depend on parsing page one.

Now suppose each step runs in its own goroutine, and the fetch goroutine hands each page to the parse goroutine through a channel. While page one is being parsed, page two is already being fetched

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content