Parallelism implies concurrency but not the other way round right?
Posted
by
Cedric Martin
on Programmers
See other posts from Programmers
or by Cedric Martin
Published on 2012-07-01T11:40:03Z
Indexed on
2012/07/01
15:23 UTC
Read the original article
Hit count: 376
I often read that parallelism and concurrency are different things. Very often the answerers/commenters go as far as writing that they're two entirely different things. Yet in my view they're related but I'd like some clarification on that.
For example if I'm on a multi-core CPU and manage to divide the computation into x smaller computation (say using fork/join) each running in its own thread, I'll have a program that is both doing parallel computation (because supposedly at any point in time several threads are going to run on several cores) and being concurrent right?
While if I'm simply using, say, Java and dealing with UI events and repaints on the Event Dispatch Thread plus running the only thread I created myself, I'll have a program that is concurrent (EDT + GC thread + my main thread etc.) but not parallel.
I'd like to know if I'm getting this right and if parallelism (on a "single but multi-cores" system) always implies concurrency or not?
Also, are multi-threaded programs running on multi-cores CPU but where the different threads are doing totally different computation considered to be using "parallelism"?
© Programmers or respective owner