Maker Pro
Maker Pro

synchronization

I am trying to understand what is thread synchronization

https://en.wikipedia.org/wiki/Synch...mmonly used to implement data synchronization.

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.

Multiple_Processes_Accessing_the_shared_resource.png

I am looking help to understand Thread synchronization
 
What is it that you don’t understand?.
Thread synchronisation simply means one after another in an orderly manner. The others, 2nd, 3rd, 4th wait for their turn.
1st process calls for data or instructions while 2nd and 3rd process waits. Then 2nd process calls for data or instructions while 3rd process waits. Once these instructions have been executed in order, they were synchronised.

Martin
 
Google mutex
.
Generally any process wanting to run the critical code or any other element that is not thread-safe, will check a flag to see whether it is currently being used. If not, then it will set the mutex flag, so others know it is being used, use the shared resource and remember to unset the flag when it completes to prevent locking others out afterwards.
 
Synchronisation simply means that all processes / operations refer to the same Time Base or Clock. This is done so that the sequence of processes do not Break or Overlap.
Generally, you may have multiple sequential processes, called threads, going on at the same time. They may interact in between or at the end. Time synchronisation is, obviously, critical.
Locking on all these processes to the same Time Reference is Thread Synchronisation.
 
Top