This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threadsafe  RSS feed

 
SrinivasaRao Swarna
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Webcontainer is thread safe?
if yes or not how is it possible?
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • 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.
 
Neo Phesus
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!