Grokking Concurrency in Go
Vote

0% completed

​

Data Races

A small service kept a count of the requests it had served in a plain int. Each request ran in its own goroutine, and each goroutine added one to the count when it finished. During a load test, the load-testing tool sent 400,000 requests and every one succeeded. The service reported that it had served 169,323.

Nothing crashed, nothing logged an error, and the same test run a second time printed a different number. On a developer laptop with a lighter load, the count was sometimes exactly right. The code that produced these numbers was one line long: count++.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content