I’m looking for some canonical, simple concurrency problems, suitable for demonstrating usage of a library for concurrent computations I’m working on.
To clarify what I mean by “concurrency”: I’m interested in algorithms that utilize non-deterministic communicating processes, not in e.g. making algorithms like quicksort run faster by spreading the work over multiple processors. This is how I’m using the term.
I know about the Dining Philosophers Problem, and that would be acceptable, but I wonder whether there are any more convincing but equally simple problems.
I generally use a simple “bank account transfer” scenario. For example I posted one such trivial case in this question on transactions.
It’s a good case for exposition because:
To demonstrate your concurrency library, you could probably start a thread running millions of transactions in this kind of scenario, and demonstrate how other threads can still see a consistent view of the world etc.