I've been reading about concurrency, multi-threading, and how "the free lunch is over". But I've not yet had the possibility to use MT in my job.

I'm thus looking for suggestions about what I could do to get some practice of CPU heavy MT through exercises or participation in some open-source projects.


Edit: I'm more interested in open-source projects that use MT for CPU-bound tasks, or simply algorithms that are interesting to implement using MT, rather than books or papers that only describe the tools like threads, mutexes and locks, or how MT can be used to have responsive GUIs...


6 Answers 6


Joseph Albahari's article on Threading in C# is one of the best resources I've seen.

The Table of Contents is below. Note that some of the topics, like the Task Parallel Library, are specific to .NET, but much of it is applicable to other languages, especially Java.

Introduction and Concepts
Join and Sleep
How Threading Works
Threads vs Processes
Threading’s Uses and Misuses
Creating and Starting Threads
Passing Data to a Thread
Naming Threads
Foreground vs Background
Thread Priority
Exception Handling
Thread Pooling
Thread Pooling via TPL
Thread Pooling Without TPL
Optimizing the Thread Pool
+ Synchronization Essentials
+ Locking
+ Thread Safety
+ Event Wait Handles
+ Synchronization Contexts
+ Event-Based Asynch Pattern
+ BackgroundWorker
+ Interrupt and Abort
+ Safe Cancellation
+ Lazy Initialization
+ Thread-Local Storage
+ Timers
+ Nonblocking Synchronization
+ Signaling with Wait and Pulse
+ The Barrier Class
+ Reader/Writer Locks
+ Suspend and Resume
+ Aborting Threads
+ Parallel Programming
+ Why PFX?
+ The Parallel Class
+ Task Parallelism
+ Working with AggregateException
+ Concurrent Collections
+ SpinLock and SpinWait

You can also have a look at Jon Skeet's tutorial here: http://www.yoda.arachsys.com/csharp/threads/

  • 3
    I add the Jon Skeet's c# mutlithreading page to your answer: yoda.arachsys.com/csharp/threads
    – user2567
    Dec 31, 2010 at 0:31
  • 1
    Second that, liked Albahari's 5 chapters extremely helpful. To practice, here's a simple exercise - Create a multiplayer tic-tac-toe game using WCF (if you know), and a simple UI - try updating the UI controls with responses from each player. Have you checked firefox code?
    – Narayana
    Jan 3, 2011 at 19:06
  • would you mind explaining more on what it does and why do you recommend it as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange
    – gnat
    May 12, 2013 at 21:50
  • 1
    @gnat: I pasted the table of contents into my answer. May 13, 2013 at 0:20
  • The link to Jon Skeet's tutorial didn't seem to be working (I was getting an Azure 404 page) - here's an archive of it: web.archive.org/web/20181010053742/http://www.yoda.arachsys.com/… Jun 4, 2019 at 17:36

Java Concurrency in Practice is one of the best books about multi-threading and concurrency. Although all the examples in the book are Java based, this book gives a solid explanation of MT world. It helped me a lot when I was developing a M-T system.

  • 4
    +1 good book. And it's Java Concurrency in Practice, not Action.
    – talonx
    Dec 31, 2010 at 4:30

Chapter 11 of the book Intel Threading Building Blocks by James Reinders is devoted to examples of algorithms and projects that make use of Parallel Computing (or Parallel Programming): a substring finder, the Game of Life, a Sieve of Eratosthenes, Matrix Multiply, and then other more advanced topics like network packet filtering and games.


I found Concurrent Programming on Windows by Joe Duffy to be very helpful. There's a lot of depth. It doesn't pull any punches, so you really get a good feel for how many ways there are to shoot yourself in the foot. It helped me to be cautious, which is the best advice I can give anyone starting with MT apps.


There's a difference between concurrency and parallelism. Concurrency is the act of doing more than one thing at a time, like writing to 2 files. Parallelism is the act of speeding up programs by using multiple cores.

Although there's no free lunch when it comes to concurrency, in parallelism the lunch is certainly becoming more free, see developments like http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell

  • 2
    Your distinction is incorrect. Concurrency is the act of completing multiple tasks in overlapping time periods while not necessarily doing more than one thing at any given time. Parallelism is the act of doing more than one thing at any given time. Nov 12, 2014 at 15:39
  • If they overlap, you are in the process of doing more than one thing at a time. Nov 17, 2014 at 10:31
  • If their start and end times overlap, this does not indicate that both tasks are proceeding simultaneously at any given time. Given two lists of integers to sum, either you can get two people to sum each list independently and simultaneously, which is both concurrent and parallel, or you can sit down and alternate between summing up the entries in one list and the entries in the other list, which is concurrent but not parallel. Nov 17, 2014 at 14:57
  • I didn't say they were happening simultaneously. I said doing more than one thing at a time. Nov 20, 2014 at 18:21
  • Doing more than one thing at a time is the same as doing two things simultaneously. If multiple things are occurring at a given time, they are occurring simultaneously. Nov 20, 2014 at 18:43

This site has some good project examples in general. www.planet-source-code.com

Just pick a language and search for multi-threading. you should see a number of projects with source code available.

  • I'm surprised this hasn't been up-voted yet. This is the only answer I saw which focuses on the question "how to PRACTICE parallel & concurrent programming". Every other answer addresses the question "how to learn the concepts", which is a different question.
    – Josiah
    Jan 16, 2016 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.