Answer the question
In order to leave comments, you need to log in
Spring, why don't we use synchronize?
How does multithreading work in a Spring application? It uses servlets, a thread is created per user, so why don't errors occur?
Without a framework, we have to synchronize methods, but here we call methods of other classes from the controller without synchronize, why doesn’t the code break?
Silly question, I know, but I would be very grateful for the answer.
Answer the question
In order to leave comments, you need to log in
Multithreading works exactly the same.
synchronized is used whether you use any frameworks or not.
Multithreaded applications can be written without any locks at all, resolving access to resources by architectural decisions, using immutable types, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question