Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Achieving thread safe without synchronize
Joined: May 17, 2004
Oct 03, 2005 02:46:00
Can some one just tell me how to have
thread safe without using synchornizing a block in my code.
Joined: Feb 27, 2002
Oct 03, 2005 04:46:00
Create new objects (if it is possible) to avoid synchonization.
Joined: Dec 11, 2004
Oct 03, 2005 04:51:00
Don't use instance variables.
Declare all of your variables inside your doGet and doPost methods.
This will take you a long way.
If you have multiple requests accessing context or session scope objects, you may need to do some more thinking. There are no simple rules in these cases.
How to ask a question...
Simple Servlet Examples
I agree. Here's the link:
subject: Achieving thread safe without synchronize
vetor thread safe?
what is means by thread save ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013