Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advanced multithreading - Java [closed]

I don't come across work that requires much experience with multi-threading. So I was wondering if anyone know of site (open source project) where I could take look at real world examples of some heavy duty code that takes care of thread pools solves deadlock situation, uses nonblocking algorithms, reentrant locks, join-fork, futures-callables well you get the idea.

To be more specific I'm looking for J2EE and MOM integration and messaging used between them.

like image 214
MatBanik Avatar asked Jun 28 '11 14:06

MatBanik


People also ask

Do Java threads close automatically?

A thread is automatically destroyed when the run() method has completed. But it might be required to kill/stop a thread before it has completed its life cycle. Previously, methods suspend(), resume() and stop() were used to manage the execution of threads.

Is multithreading still used in Java?

Java has great support for multithreaded applications. Java supports multithreading through Thread class. Java Thread allows us to create a lightweight process that executes some tasks. We can create multiple threads in our program and start them.

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.


2 Answers

These use everything you have mentioned and have the benfit of being quite well documented from a design point of view too.

JGroups, Jboss Cache and its successor Infinispan

like image 59
pillingworth Avatar answered Sep 30 '22 00:09

pillingworth


Maybe have a look at the original Java java.util.concurrent package. That must be state of the art.

like image 21
PeterMmm Avatar answered Sep 29 '22 22:09

PeterMmm