You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
스프링mvc는 요청당 스레드를 할당
그런데 모든 스레드들이 하나의 컨트롤러에 진입해서 요청 처리를 진행하는데 어떻게 이게 가능한것인가.
컨트롤러도 어쨋든 하나의 객체다
jvm 메모리구조에서 객체는 어디에 저장되는가?
힙 영역이다!!!
그리고 이 객체의 매서드등은 코드(method area) 영역에 존재하며
그리고 각 스레드는 스택을 제외한 나머지 영역을 공유한다..
즉 컨트롤러의 매서드가 stateless하게 구성되어있다면 모든 스레드들은 컨트롤러 매서드를 공유하고
이 컨트롤러의 상태를 변화시키는 동작은 없기에 동시성 문제가 존재하지 않으며
각 스레드는 개별적인 스택영역을 활용하여 서비스 로직처리가 가능하다.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: