• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

page directive- isThreadSafe

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Narendra!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic