Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Threadsafe

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Webcontainer is thread safe?
if yes or not how is it possible?
 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Swarna,

I haven't seen any web developer programming Container which will guarentee thread safety of Servlets, Jsps.

Its not possible for Container also.

Instead while programming servlets and jsp the developer has to ensure that they will be thread-safe by using locks(synchronized) where data sharing problems can occur.

What we can tell container is "whether it can create multiple threads or not(deprecated SingleThreadModel)" which is no way guarentee Thread saftly

Thats my view point.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, thats right. I agree with Srinivas.

Well, the container's does not or has no need to know why and how we achieve synchronization in our application And, if at all we expect the containers to do that for us, it can't be generalized in any way or in other words its not going to be common across web applications.

Its going to be our design level responsibilty and developer's duty to take care of those stuff.

Please correct me if I am wrong I am still in the process of learning....
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Neo Phesus,

Neo Phesus says:
I am still in the process of learning....



We are never going to stop it.
The moment one stops learning he is out of race.
What you say.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nor the container nor the servlets are thread safe .

But you have to write the servlets is such a way that its thread safe.There is only one instance of servler serving all the requests to that servlet.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Srinivasan thoyyeti:
Hi Neo Phesus,



We are never going to stop it.
The moment one stops learning he is out of race.
What you say.



AGREE !
 
SrinivasaRao Swarna
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply,


Any way, once again thanks for your reply.

Thanks&Regards
Srinivas
 
Neo Phesus
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree folks...

Learning is a continous process...Like some one said..."Each and every second of life is a lesson...But we fail to read it"
reply
    Bookmark Topic Watch Topic
  • New Topic