Thread Disadvantages

What are the disadvantages of using thread?

Questions by ankitchauhan22

Showing Answers 1 - 3 of 3 Answers

while using threads, each thread has access to object's instance variable. so while one thread is making changes to that instance variable, another thread may access it. It results in inconsistency. so all methods which access important instance variables should be marked synchronized. Or atleast the part of that method which accesses that important instance variable should be marked synchronized to prevent another thread to access that instance variable when this thread is currently accessing it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions