Forums Register Login

page directive- isThreadSafe

+Pie Number of slices to send: Send
Hello All,
I'm confused about the page directive- isThreadSafe.
Thread safety means that no two concurrently executing threads can alter the instance variables.

isThereadSafe="true", according to my understanding means that the generated servlet implements SingleThreadModel interface.

isThreadSafe="false" [default is false] means that it doen't implement the marker interface, so it's the responsibility of the prgrammer to use synchronization mechanism.

Pls. correct me if I'm wrong.

Thanks
Reema
+Pie Number of slices to send: Send
Hi,

isThreadSafe defaults to true. This means that the user has taken care of thread saftey issued in his coding, and the container do not requre to take care.

isThreadSafe to false means that the conatiner should take care of thread saftey. The container do this using SingleThread Model. This model is deprecated in the current version and give the false implecation that the Servlet is thread safe.

Thanks
+Pie Number of slices to send: Send
Thanks Narendra!
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 511 times.
Similar Threads
isThreadSafe is false for Single Thread Model?
Doubt abt Page directive
About SingleThreadModel
Thread Safe Servlet
synchronization on request?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:19:03.