Synchronization in Operating system

Synchronisation or Synchronization however you spell it, it just refers to one main word, that is, SYNC. Now in order to understand what Synchronisation is you first need to the understand this sync, basically we often use this like... "The dancers were in perfect sync" or The processes are in sync", or even we refer to our data being in sync with our Microsoft Account or Cloud Storage . 

This simply, means that when 2 or more things are in sync, they are working together at the same time without affecting each other or without manipulating each other's work, like when we study with our friends, that is the case of Synchronization right? No! You may start with Operating System and end up with Data Science. Because you can get affected by the working of the other process, in this case your friend, well, maybe this was the worst example I could come up with, but it is what it is... It's 11:04 in clock, and I am thinking of going to bed at 11:30 today, thinking, yeah. 

Now, for Synchronisation we need to understand the 2 types of Processes, that is, Cooperative Processes and Independent Processes, just from the names you can clearly understand the working of both, assuming... So, for Synchronisation we only deal with Cooperative Processes because what's the use of Synchronisation if the 2 things work completely independently?

So, we got in Sync, now we got Cooperation, and now comes the Condition for Sync, bcz we cannot just say something is in sync right? We gotta have a definition or some format for that!

There are 4 Conditions, first 2 are Primary Conditions and the next ones are... Guess What? Secondary! 

- Mutual Exclusion

- Progress

- Bounded Wait

- No assumptions related to Hardware of the System

just know that the code that 2 or more processes share is called the Critical Section.

so, mutual exclusion just refers to the fact that there should be just 1 process in the Critical Section at once, means if there would be more then they would make a mess.

Now, progress says that every process should make progress and there should not be any condition like Deadlock.

Bounded Wait says that every Process that is waiting for some other process should have a limit( bound ) for it's wait, means is shouldn't be like just 1 Process or other Processes are being given chance to access the Critical Section every process should be able to access it.

Lastly there shouldn't be any assumptions related to the Hardware, means whatever algo or way we bring to get things( processes ) in synchronisation it shouldn't depend on the Hardware or things like Processor etc.

Overall this is the starting stage, to bring the Concepts into Light that were brought to bring Synchronisation in the Play.

With that note Cya!

Comments

Popular Posts