Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Concurrency - best complete tutorial and sample code needed [closed]

Can you please suggest some good tutorial for Java Concurrency. Where can i get some sample code also.

like image 766
Ravikumar Maddi Avatar asked Jan 07 '11 10:01

Ravikumar Maddi


People also ask

Is Java Concurrency in Practice still valid?

TL: DR — Yes, Java Concurrency in Practice is still valid and one of the best books to learn Java multithreading and concurrency concepts.

What is concurrency in Java with example?

Concurrency is the ability to run several or multi programs or applications in parallel. The backbone of Java concurrency is threads (a lightweight process, which has its own files and stacks and can access the shared data from other threads in the same process).

How do you resolve concurrency issues in Java?

The main way we can avoid such concurrency issues and build reliable code is to work with immutable objects. This is because their state cannot be modified by the interference of multiple threads. However, we can't always work with immutable objects.

What is the difference between multithreading and concurrency in Java?

Multitasking - Multiple tasks/processes running concurrently on a single CPU. The operating system executes these tasks by switching between them very frequently. The unit of concurrency, in this case, is a Process. Multithreading - Multiple parts of the same program running concurrently.


2 Answers

This is also a nice series of articles covering the topic:

http://www.baptiste-wicht.com/2010/05/java-concurrency-part-1-threads/
http://www.baptiste-wicht.com/2010/05/java-concurrency-part-2-manipulate-threads/
http://www.baptiste-wicht.com/2010/08/java-concurrrency-synchronization-locks/
http://www.baptiste-wicht.com/2010/08/java-concurrency-part-4-semaphores/
http://www.baptiste-wicht.com/2010/09/java-concurrency-part-5-monitors-locks-and-conditions/
http://www.baptiste-wicht.com/2010/09/java-concurrency-atomic-variables/
http://www.baptiste-wicht.com/2010/09/java-concurrency-part-7-executors-and-thread-pools/

like image 82
a_horse_with_no_name Avatar answered Nov 24 '22 00:11

a_horse_with_no_name


First google link:

http://download.oracle.com/javase/tutorial/essential/concurrency/

like image 22
dagnelies Avatar answered Nov 23 '22 23:11

dagnelies