Monday, April 14, 2014
Haskell Week 7
Concurrency vs Parallelism
According to the Haskell Documentation there is a distinct difference between concurrency and parallelism.
Parallelism is "a technique to make programs faster by performing several computations in parallel. This requires hardware with multiple processing units" (Haskell)
Whereas, concurrency "refers to techniques that make program more usable. Concurrency can be implemented and is used a lot on single processing units, nonetheless it may benefit from multiple processing units with respect to speed". (Haskell)
So what exactly is the difference?
According to Simon Mar, in his blog ghcmutterings, "a concurrent program is one with multiple threads of control" all of which operate on one processor and share that processors resources.
This leads to the question what is a thread?
Threads are contained inside of processes a process can have multiple threads all of which share the processes resources, but they are also able to accomplish goals individually. An application may have multiple processes, and these processes may spin up multiple threads. The key to this is they all happen on one processor.
The key distinguishing factor with parallel processing is that more than one CPU is needed.
There has been an extensive amount of research as to the benefits of parallelism.
I found Simon Mar's research to be very helpful in trying to understand this very complex and high level issue
http://community.haskell.org/~simonmar/par-tutorial.pdf
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment