Maker Pro
Maker Pro

synchronization

champ1

Jul 17, 2018
55
Joined
Jul 17, 2018
Messages
55
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
 

Martaine2005

May 12, 2015
4,932
Joined
May 12, 2015
Messages
4,932
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
 

Nanren888

Nov 8, 2015
622
Joined
Nov 8, 2015
Messages
622
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.
 

ramussons

Jun 10, 2014
462
Joined
Jun 10, 2014
Messages
462
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