Originally posted by vamsikrishna Gunturi:
Hi i am trying to run a genericservlet(not httpservlet) implementing a singlethreadmodel.
SCJP, SCWCD.
|Asking Good Questions|
Originally posted by vamsikrishna Gunturi:
But everytime i make a new request i am getting new thread id.
i expect that each counter is unique,but i am getting same counter for all..
SCJP, SCWCD.
|Asking Good Questions|
when i implemented a singlethreadmodel interface , the servlet container need to reuse the same thread for multiple requests to same servlet.
But it is creating a new thread for every request.
When i open the same servlet in three different browser windows and run them one after another quickly,i expect that each counter is unique,but i am getting same counter for all..
...the servlet container need to reuse the same thread for multiple requests to same servlet.But it is creating a new thread for every request.
why it is allowing multiple threads to access same resourse even though when i mentioned that it has to implement SingleThreadModel..
The only guarantee that's given is that multiple threads won't do so at the same time.
It is allowing to access same resourse for more than one thread at the same time
..as per STM..the server should not allow the second thread to read the uncommitted value
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |