Jayashree C.H
Answered On : Jun 27th, 2005
yes.the performance will be down if we use synchronization.
one can minimise the penalty by including garbage collection algorithm, which reduces the cost of collecting large numbers of short- lived objects. and also by using Improved thread synchronization for invoking the synchronized methods.the invoking will be faster.
regards
Jayashree C.H
Login to rate this answer.
Faisal Ghauri
Answered On : Jul 24th, 2005
Performance does take a hit when using synchronization. I think the way to reduce this hit is to synchronize only a block of code that will be accessed by threads and not synchronize the entire method.

5 Users have rated as useful.
Login to rate this answer.
ganeshh
Answered On : Mar 29th, 2007
It is very useful because we can make only one thread to access the resources at a time with this we can avoid deadlock situation.
Login to rate this answer.
The Synchronization may be useful in avoiding the deadlock, helpful in maintaining the consistent object state etc,. Only one thread will be accessed at a time by acquiring lock on the synchronized block or method etc,.
The Synchronization at in appropriate level, will definitely hampers the performance.
One should strike a balance between the data sensitivity and performance.
Regards,
Srinivas Dasamanthula

1 User has rated as useful.
Login to rate this answer.
There is degradation in performance when you make a method synchronized. Even when a program contains only a single thread running on a single processor, a synchronized method call is still slower than an unsynchronized method call. If the synchronization actually requires contending for the lock, the performance penalty is substantially greater, as there will be several thread switches and system calls required.
For a good design to improve the performance you must first identify what data will be shared across threads. If you are writing data that may be read later by another thread, or reading data that may have been written by another thread, then that data is shared, and you must synchronize when accessing it.
Login to rate this answer.