In this blog post we will talk about What are common multi-threading issues faced by Java Developers? One thing I would like to make you clear here is that this post only listed out the common multi-threading issues faced by Java Developers but not the detail explanation with example.
Below is the list of issues that can occur in a multi-threading application:
• Non-synchronized access to the fields of a shared mutable class.
• Reusable objects used as a lock.
• We should do double checked locking if we write Singleton class for multithreaded applications.
• Invoking a blocking method with lock hold.
• Visibility issues with the data because getters were not synchronized/published correctly.
• Starting a thread from within the constructor causing partially initialized objects.
• ConcurrentModificationException due to illegal structural modification to the collections.
• Failed to handle exception from background thread.
• Synchronized on immutable objects like String is useless and error prone.
You may also like:
What are fail-fast and fail-safe Iterator?
Why Prime Numbers are considered in writing certain algorithms like hashcode()?
What are the important paradigms for Developing the Clean Object-Oriented Code?
What are new Features added in Java 8?
That’s all about What are common multi-threading issues faced by Java Developers?
If you have any feedback or suggestion please feel free to drop in blow comment box.