Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8147129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:14:42+00:00 2026-06-06T14:14:42+00:00

Possible Duplicate: Why is (javax.servlet.)SingleThreadModel deprecated? A servlet container generally create one instance of

  • 0

Possible Duplicate:
Why is (javax.servlet.)SingleThreadModel deprecated?

A servlet container “generally” create one instance of a servlet and different threads of the same instance to serve multiple requests. (I know this can be changed using deprecated SingleThreadModel and other features, but this is the usual way).

I thought, the simple reason behind this is performance gain, as creating threads is better than creating instances. But it seems this is not the reason.
On the other hand, creating instances have little advantage that developers never have to worry about thread safety.

I am trying to understand the reason for this decision over the trade-off of thread-safety.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:14:44+00:00Added an answer on June 6, 2026 at 2:14 pm

    Note that SingleThreadModel does not solve all thread safety issues.
    For example, session attributes and static variables can still be
    accessed by multiple requests on multiple threads at the same time,
    even when SingleThreadModel servlets are used. It is recommended that
    a developer take other means to resolve those issues instead of
    implementing this interface, such as avoiding the usage of an instance
    variable or synchronizing the block of the code accessing those
    resources.

    Please refer this thread for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How do I import the javax.servlet API in my Eclipse project? When
Possible Duplicate: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25; I am
Possible Duplicate: Java float division precision I'm trying to fix a bug in one
Possible Duplicate: Java: recommended solution for deep cloning/copying an instance I have an object
Possible Duplicate: Populating child dropdownlists in JSP/Servlet JSP: drop down list 2 depends on
Possible Duplicate: How to get UTF-8 working in java webapps? I have a servlet
Possible Duplicate: javax.net.ssl.SSLException: Not trusted server certificate I am trying to connect to server
Possible Duplicate: Java inner class and static nested class An instance of a static
Possible Duplicate: Java: Start Mail-Client with Attachment? I need to create a java code
Possible Duplicate: why import javax.swing.* why not import java.swing.* This may seem as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.