Practical problems include several activities that are carried out simultaneously. The solution to these problems is implemented with programs that consist of a collection of concurrent tasks, also known as threads.
A computer with a single CPU can actually only perform one task at a time. Concurrency is a general programming technique that allows the execution of multiple threads that appear to be running simultaneously. This simplifies the implementation of applications with multiple "simultaneous" tasks. The implementation represents an application with multiple threads.
This chapter presents a very simple and general discussion of programs with multiple threads. There are no complete programs included. More detailed concepts and techniques are treated in advanced textbooks on programming and on operating systems.