by
Roba Al-Assi , Brand and Communications Director , Bayt.com
Concurrent programming is about executing multiple unrelated tasks in a concurrent mode. What these un-related tasks share are system resources, but they do not share a common problem to solve; meaning, they are logically independent. This makes concurrent programming extremely difficult and debugging complicated.
Parallel programming is taking a certain task and dividing it into a set of related tasks to be executed concurrently. This makes Parallel Programming even more difficult and debugging even more complicated.
Parallel Programming:
A parallel program is one that uses a multiplicity of computational hard-ware (e.g. multiple processor cores) in order to perform computation more
quickly. Different parts of the computation are delegated to different pro-cessors that execute at the same time (in parallel), so that results may be
delivered earlier than if the computation had been performed sequentially.
T1 and T2 may be executed simultaneously at the same instance of time.
Concurrent Programming:
Is a program-structuring technique in which there are multiple threads of control with distinct responsibilities and purposes, which may run simultaneously or take turns.
It may appear to the user that both things are being run in parallel, even though they're actually being processed in serial.
T1 may be executed and finished before T2.
T2 may be executed and finished before T1.
T1 and T2 may be executed alternatively.