Comprehension of Concurrency is a Lifelong Journey
Accept that your understanding is imperfect. There is comfort in letting go.
NOTE: Check out the other posts from the Concurrency War Stories series here.
Years ago, I was debugging an issue with a colleague. We stared at error logs and a thread dump, trying to understand why a particular part of the system was running slower than desired. It seemed that there were too many threads fighting for CPUs, and the threads we wanted to win the battle were losing badly.
I said: “This is weird. Threads don’t just get kicked off the CPU once they start running.”
He said: “Threads absolutely get kicked off of the CPU while they are running. That happens all the time.”
I felt stupid. But I could immediately see the positive: I was less stupid after that exchange than I was before it.
I gave an internal talk called “Concurrency War Stories” at my job a few years ago. The intent was to share examples of interesting situations I’ve encountered in my career that involved concurrency in some form.
I recently found a copy of the video and put it on YouTube. Take a look if interested:
Many of my concurrency-related investigations have decomposed into “Why is this thing so slow?” (great post on this topic here) or “What is the system doing?”, which are both very general questions with nothing in particular to do with concurrency.
I often confirm at the end of an investigation that I don’t really understand anything, but once again, I know a little more now than I did before.
Accept that your understanding is imperfect. You will occasionally say stupid things and think stupid thoughts. I will likely say many stupid things during the lifetime of this newsletter. In time, the universe will correct us. There’s comfort in letting go.