Multi-Threading: My study plan

One of the things I’m trying to understand better is multi-threading. This is one of those concepts where you can go as deep down the rabbit hole as you have an appetite to go down.

I have always felt that my multi-threading knowledge is “ok” for my daily needs:
I understand the normal synchronization problems with multi-threading (deadlocks; race conditions). I have an understanding of the mechanics of locks and mutexes. I have some appreciation of Windows threads – syntax, how they are created/executed with the main program I work on, how to debug them etc.
However, those things have left me uneasy that I don’t really know what is going on.

For some time, I have therefore wanted to go back to basics and build up a better understanding of multi-threading from the bottom up. My current study plan looks as follows:

  1. Better understand synchronization concepts and classic synchronization problems in the abstract

    So you know about locks & mutexes… What about semaphores and condition variables? How do atomics fit into this? What about lock-free programming? So you know about deadlocks and race conditions… What about starvation? How do you solve typical synchronization problems? (E.g. dining philosophers; readers-writers problem)

    At the moment, my plan is to devour Downey’s Little Book of Semaphores for this step: take a whole lot of notes, solve the exercises in the book and then google all of the concepts I come across I am not familiar with.

  2. Understand language specific threading concepts and implementations

    After understanding threading concepts in the abstract, it’s important to actually get round to do some implementing (think: “learning by coding” or some similar non-sense). To do that, I first need to understand what concepts languages offer. For now, I’m planning to start with the language I am most comfortable in (C++). Here, the standard book on the topic (incorporating C++ 11 threading details) seems to be Williams’ C++ Concurrency in Action. For C#, I was planning on looking through Albahari’s free ebook on threading.

    (While the C++ book comes with lots of positive reviews, I haven’t really found anything on this. So this is taking a little bit of a chance.)

    For javascript, I was only planning to have a little bit of a google around.

    (I imagine there will be a fair number of differences here depending on what execution environment we are talking about…)

  3. Implement the problems described in Downey’s book

    After that, it’ll be time to actually get my teeth into implementing the problems I have looked and solved at in the abstract in code.

Given that I am also planning on spending a fair amount of time on software processes, TDD and such Agile rubbish, I think getting through this list may well take till the end of January or so. I’ll add some posts on how I am getting on with this.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s