• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page directive- isThreadSafe

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Narendra!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic