Concurrency

Concurrency means multiple computations are happening at the same time. Used everywhere in modern programming. (However I’ve never done any of it yet as of the end of 2B studying as a Software Engineering at the University of Waterloo).

Concurrency encompasses a host of design issues, including communication among processes, sharing of and competing for resources (such as memory, files, and I/O access), synchronization of the activities of multiple processes, and allocation of processor time to processes.

Difficulties of Concurrency

  • Sharing of global resources
  • Operating System managing the allocation of resources optimally
  • Difficult to locate programming errors

A simple Example

Setup: two processes / two threads

What are possible outputs?