Difference between Threads and Process and static variable --- Who will create new thread for each Http Rest Request
1) Threads manage separate Stacks. 2) Heap Area (Objects/Static variables/files etc.. keeping area) is same for all the threads in one process. But from diffent threads of same process can not access them since referance is keeping in stack area (becouse of 1 point) and they are creating theyown object 3) Child thread can access parent thread's variables. 4) Process means totally different program execution. 5) First gothrough the producer and consumer problem(at last of this blog you can see the code) then , gothrough the rest Api thread senario explained below both are very same. ............................................................................................................... Does Spring create new thread per request in rest controllers? --> Not spring , the tomcat will create --> for more details have a look below V.V.V.V When new HTTP request come, A new thread will not be created for whole rest controller class ...