Explain thread Synchronization with suitable example?
Answers
Answered by
1
Explanation:
When we start two or more threads within a program, there may be a situation when multiple threads try to access the same resource and finally they can produce unforeseen result due to concurrency issues. For example, if multiple threads try to write within a same file then they may corrupt the data because one of the threads can override data or while one thread is opening the same file at the same time another thread might be closing the same file.
example :
Java
Similar questions
English,
7 months ago
Physics,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
Physics,
1 year ago