Solved

Multithreading implemetation

Posted on 2013-06-22
5
214 Views
Last Modified: 2013-06-23
Hello,

I get lot of question being asked  as "where one has to use multi threading implementation environment"
i hope, it is not at the  receiving of large no of requests which would be not at   Servlet, as it will allow only single threading environment or synchronisation  

can one use  it in maintaining at the resource pooling in terms of caching environment...
Any more suggestion would be appreciated in terms of code....

thanks
0
Comment
Question by:roy_sanu
  • 3
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39268468
Not quite sure what you're saying about servlets. They are by default multithreaded
0
 
LVL 16

Expert Comment

by:krakatoa
ID: 39268537
Anywhere you need to replicate a task asynchronously.
0
 

Author Comment

by:roy_sanu
ID: 39268964
thanks all.
Since in multithreaded servlets, all the user shares the same instance(if I understand correctly), the instance varibles will also be shared by all the clients. This is apparently a problem. The approach is handle this is to avoid using instance variable in multithreaded servlets? How that can be achieve ???
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39268971
How that can be achieve ???
By using automatic (local) variables

http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-threadsafe.html?page=1

Or use synchronization techniques (see above link)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39269140
:)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
javap not working 8 58
null output 3 35
SequenceInputStream example 3 19
jsp CRUD operations with and without prepared statement also hibernatge 1 9
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question