ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is race condition in java? How will you find and solve race condition?

user-image
تم إضافة السؤال من قبل Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
تاريخ النشر: 2015/02/12
mostafa mohamed korkar
من قبل mostafa mohamed korkar , java developer , Etisalat misr

A race condition occurs when two or more threads can access shared data and they try to change it at the same time.

To Solve : 

In order to prevent race conditions from occurring, you would typically put a lock around the shared data to ensure only one thread can access the data at a time. where you will use the keyword Synchronized