Solved

Multithreading implemetation

Posted on 2013-06-22
5
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 134
login form jsp example 2 68
SequenceInputStream example 3 34
Java Eclipse Loop 3 45
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

739 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