• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Multithreading, concurrency and parellel programming  RSS feed

 
Pankaj Shet
Ranch Hand
Posts: 313
Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

May I know the difference between Multithreading, concurrency and parellel programming?
I am new to parellel Programming.

Regards,
-Pankaj.
 
Henry Wong
author
Sheriff
Posts: 22866
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pankaj Shet wrote:
May I know the difference between Multithreading, concurrency and parellel programming?
I am new to parellel Programming.


Well, since you are new to thread programming, it is probably okay to just treat all these terminology as the same.

Once you get more into the details, there are some distinctions. Concurrency is basically the use of threads to attempt multiple tasks simultaneously (along with the synchronization to allow it to be done in a safe manner) -- for example, you are modifying a database, while updating a GUI. etc.

Parallelism is a bit more than that, it is an examination of how efficient a concurrent application is, is using the processor resources. For example, you may be able to achieve concurrent access to the database and the GUI, but there is unlikely much need for parallelism; these concurrent threads can run on a single core processor, and time slice between them, and it will likely work fine.


As a side note, in GC speak, they define another distinction. A concurrent GC is one that doesn't stop-the-world -- the application still runs while it is collecting garbage. A parallel GC is one that uses more than one (ideally all) core(s). However, it may still be stop-the-world during the GC cycle.

Henry
 
Pankaj Shet
Ranch Hand
Posts: 313
Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Henry for your reply, I got the overview, but wish to get more details on the same.

I am using Java Threads for Multithreading (Scott Oaks and Yourself O'Reilly publication), Java Concurrency in Practise for Concurrency. Please suggest the best book on Parellel Programming in Java...?

For Multithreading what is the latest edition?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!