Tackling contention: the monsters inside the `sync.Locker`
A deep dive on contention: what is it, when is it expensive, and how to tackle it.
Some light will be shed on ways to measure the computational power wasted waiting. The trace/block and pprof tools and libraries will be explained with actionable examples.
After showing how to find contention issues, some handy ways to address them will be shown:
Splitting work: different ways to change common algorithms to not have a centralized state.
From channels to mutexes: where it makes sense to make the switch, and why.
From mutexes to atomics: the real price of making this step, and how to make an informed choice about it.
Roberto is a Security Engineer at Google. He loves to write, hack, customize, patch and tailor any software that allows him to do so.
Roberto has been writing go since 2015 for both structured, complex projects and scripts.