For further actions, you may consider blocking this person and/or reporting abuse
Read next
How does the limit() method differ from the skip() method in streams?
realNameHidden -
I Tried Every Hot Programming Language
Kuvam Bhardwaj -
Implementing the Prototype Design Pattern in Spring Boot
pal murugan -
Como Melhorar seu Código Java: 7 Boas Práticas e Padrões de Desenvolvimento
Anderson Leite -
Top comments (4)
Threading issues are very difficult to reproduce, which is one of the reason you should design the application to minimize these issues. Immutable objects are your friend. Try to keep mutable objects to single threads and then carefully make sure that when exchanging it between threads is handled well. Think handing the object over to another thread vs lets share. If you need to share make sure they are fully synchronized objects.
Live locks - Are quite difficult to debug the way to debug them is tail your logs whilst the application is running and see them.
Deadlocks - A little easier to debug, you can get a stack trace when deadlocked. Then you can trace that back to the code and redesign the problem. The only problem is you may not get the same results twice but overall it should be fairly obvious.
Race conditons - Use something like ThreadSafe They are incredible difficult to detect usually you would find them in code review without pushing them live however sometimes they sneak through. Using Threadsafe can help with the detection whilst coding.
hope this help!
Thanks it is helpful
I think you really need to understand how threads work (in general), concurrency theory, etc.
Multi-threading is hard 😜
I would focus on the theory and not necessarily Java in particular. Once you've got that down then start applying it to Java?
Thanks ,Yes theory ll be very helpful