Hi
singlethread interface problem from Hanuman Deshmukh book at page 160,
it says that:
"The specification guarantees that if a
servlet implements this interface, the container will not execute the service() method in more than one
thread simultaneously."
I understand this is why it is OK for sample at page 161 based on above statement.
but I am not clear the following
word from Hanuman Deshmukh book at page 160.
To avoid the performance problem, a servlet container may create multiple instance of the servlet class. In short, multiple requests will still be processed simultaneously but by different servlet instance.
I dont think the container whose singlethread interface implemented by this algrithm will make
the sample code at page 161 works fine. The reason seems simple, two instances(evevn they are different) can not wirte
any information in to the same files simultaneously .
Please help me,
Thanks,