Results 1 to 6 of 6
Thread: Synchronized Servlet
- 08-23-2008, 07:04 AM #1
- 08-27-2008, 06:10 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
It means you only get one connection at a time. Any additional connection would wait until the connections before it are finished.
- 09-06-2008, 12:55 PM #3
Member
- Join Date
- Sep 2008
- Posts
- 17
- Rep Power
- 0
Hello
Yes . means at time only one thread can enter in doGet()/doPost() method.but this is not standard programming, Instead of used synchronized block on code,when you expect that more than 2 threads may operate on your code and they may inconsistent your data.
RegardsSagar Birari
Development & Technical Blog
- 09-07-2008, 04:04 AM #4
It means you won't be able to handle any load. Your application will not scale.
This is a crude solution that is not recommended.
- 09-09-2008, 09:41 AM #5
Member
- Join Date
- Sep 2008
- Posts
- 17
- Rep Power
- 0
- 09-09-2008, 08:14 PM #6
This is way to general. And perhaps misleading. There is no difference between using a synchronized block and using synchronization on an object with the same scope as the block. The compiler just does the same thing as you would manually.
If you want to get performance and scaling, you have to carefully decide what needs synchronization and what types of locking it needs. The key is to obtain the fewest locks and locks of the weakest strength practical, for the shortest time.
Look at things like java.util.concurrent.locks.ReentrantReadWriteLock
Similar Threads
-
servlet
By kondalrao.p in forum Java ServletReplies: 1Last Post: 09-06-2008, 01:10 PM -
synchronized
By bugger in forum New To JavaReplies: 2Last Post: 11-28-2007, 10:33 AM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM -
doubt about synchronized
By simon in forum Advanced JavaReplies: 2Last Post: 08-05-2007, 03:49 AM -
Return in the Middle of synchronized Block
By ariak in forum Advanced JavaReplies: 1Last Post: 07-26-2007, 10:24 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks