Operating systems - Critical sections Alon Lalezari - אלון ללזרי https://www.youtube.com/watch?v=fTJIipm4prA Transkript (automatisch erstellt) 0:01 Okay. So let's try to look to talk a little bit about critical sections in operating systems. Uh the idea of critical sections is that if I have at 0:12 least two processes that has they that both both have the same resources they may change at the same time uh some resource for example a list. 0:28 Let's take an example taking out a node in the list. Deleting a node and if I have two processes that work on that list at the same time they may delete a 0:40 node and instead simultaneously instead of deleting two nodes because two processes worked on that list. What happened is that only 0:52 one node was deleted even though two processes said or did a delete operation and this is not okay. This happens because the critical 1:06 section is a section in which two processes work on a same resource. It means that when we are looking on a code of two processes there may be 1:24 critical and non-critical sections. And when we are talking about a critical section, it's section that do something to a resource without doing something to 1:33 a resource that is shared between the two processes. This is not a critical section. So in those critical sections I need to make sure 1:45 that only one processes at a time work on it. I mean if one processes one process do a delete and one process do add or something like this to the same 1:57 resource that is shared between the processes I need to make sure that at the same time only one process is working when he's doing it because if 2:09 there will be a context switch at a time he works on the resource there may be weird things that happen as I mentioned so this is the idea of a critical 2:20 Intersection between at least two processes that work on a shared resource.