Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multithreading implemetation

Posted on 2013-06-22
5
Medium Priority
?
220 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

609 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