-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext2.txt
8 lines (8 loc) · 832 Bytes
/
text2.txt
1
2
3
4
5
6
7
8
Thread synchronization is defined as a mechanism which ensures that two or more concurrent processes or threads do not
simultaneously execute some particular program segment known as critical section. Processes' access to critical section
is controlled by using synchronization techniques. When one thread starts executing the critical section
(serialized segment of the program) the other thread should wait until the first thread finishes. If proper synchronization
techniques[1] are not applied, it may cause a race condition where the values of variables may be unpredictable and vary depending on
the timings of context switches of the processes or threads.
For example, suppose that there are three processes, namely 1, 2, and 3. All three of them are concurrently executing,
and they need to share a common resource.