we have two threads..both the threads are reading the
data.. is there any need of synchronization
there?...justify it?
Answers were Sorted based on User's Feedback
Answer / ysr
It depends upon the data.
where the data is chngable by threads at that time we need
to apply the synchronization.
if the data is purly static data no need to protect the
databy using synchronization. why because if we apply
(synchronization) each and every time there is a
performance degradation is there.
Time factor(it will take more time)
| Is This Answer Correct ? | 29 Yes | 0 No |
Answer / babu
sychronization is used to execute only one thread or one
block ata time.if your not declare sychronized in the method
there is chance to execute the mixed data i.e.; to threads
start at atime.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ranjan
synchronization is necessary in threads
problem.synchronization means at a time only one thread can
access it.If it is not done then one thread will read the
resource & other will try to update it.It will create a
problem.
| Is This Answer Correct ? | 3 Yes | 11 No |
What is multithreading ???? How to stop multithrading in java????
What happens if constructor is private?
Explain the pointers in Java?
How does linkedhashmap work in java?
Difference between Interface & Abstract class?
Is there a way to increase the size of an array after its declaration?
Difference between notify() method and notifyall() method in java?
What is variable and its types?
when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).
Name the method of a Container that can be used to cause a container to be laid out and redisplayed?
What is java class writing rules?
What is the primitive type short?