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

Servlet instances  RSS feed

 
ravi chappa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we specify that while application is loading,how many instances of servlet container should create?
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

There's always only one instance of a servlet (unless you implement SingleThreadModel, which is not very scalable). The threads spawned by the container call this instance's service method.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That also means the servlet code needs to be thread-safe, or you may run into trouble during concurrent accesses.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!