A Primer On Multithreaded Programming

Multithreaded programming has been an important part of much of what I’ve worked on in the past couple of decades. However, a lot of my work has been on high-performance server-side technologies where speed is as important as reliability and stability. Taking maximum advantage of parallel hardware technologies such as multicore processors, and synchronous multiprocessing (SMP), is a key part of maximizing performance. For some developers, particularly those starting out in the mobile device space, multithreaded programming can be pretty new. Up until this past year or so, mobile devices used a single processor. So, other than cycle-stealing or avoiding situations where you locked up the UI for extended periods, there wasn’t all that much to be gained by writing apps with multiple threads. The rise of dual-core processors (and the forthcoming quad-core processors) has made multithreaded programming more attractive, simply because there are speed advantages to be had.

To that end, I thought it would be useful for some people to have a lightweight introduction to multithreaded programming. This first primer is one of a series I hope to build up over time (my next primer will probably be on iOS observers. I get a lot of hits everyday on an early post I did on that topic). Keep in mind that the goal of this primer is not meant to be exhaustive. There are better works available to treat the subject in far more detail. My goal is to provide someone with a foundation on multithreaded programming, and enough background that they can be productive in it and will have the grounding they need if they want to explore the topic further.

The link to the primer is here. You will need some kind of PDF reader to be able to read the document. Hopefully it someone finds it useful.


5 thoughts on “A Primer On Multithreaded Programming

  1. Hi Geoff,

    Curious, have you had a chance to look at higher-levels of abstraction when it comes to multi-threaded programming? Things like Actors (Erlang, Akka) or STM (see Clojure)? I’m curious because I think trying to get traditional multi-threaded programming .e.g. java.lang.Thread, sychronized,etc, put too much of a burden on the programmer. IMO, there are frameworks that give you a much better level or abstraction, e.g. shared-memory versus nothing-shared without having to manage the intricate details.

    • One issue is that most of these aren’t available on Android, so you’re stuck on mobile operating systems with only the minimal services. I do believe that it is still useful for people to understand some of the underlying mechanics, even if only to a small degree, so that they can better use higher level frameworks and understand what they are (or are not) doing.

  2. Pingback: A Primer on Multithreaded Programming | Apple | Syngu

  3. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #993

  4. Pingback: My Homepage

Comments are closed.