The terms concurrency and parallelism are used in context of multithreaded programs. However, they are quite different. Details about these are given as follows:
Concurrency means that multiple processes or threads are making progress concurrently. While only one thread is executed at a time by the CPU, these threads can be switched in and out as required. This means that no thread is actually completed totally before another is scheduled. So all the threads are executing concurrently.
An image that demonstrates concurrency is as follows:
In the above diagram, all the four threads are running concurrently. However, only one of them can be scheduled on a processor at a time.
Parallelism means that multiple processes or threads are making progress in parallel. This means that the threads are executing at the same time. This can happen if all the threads are scheduled on parallel processors.
An image that demonstrates parallelism is as follows:
In the above diagram, all the four threads are running in parallel i.e. they are executing at the same time.