I read about the LOCK # command for an x86 processor that blocks the memory bus for the duration of the next command. There was such a question, as far as I know, for the implementation of the process locks, the following scheme is used: put a lock on changing a memory address of some (I don’t really understand how it happens in more detail), make changes, remove a lock.
The questions are as follows:
- What happens when a process / thread says it wants to block a block of addresses, for example 1024-1040? Is some bit set somewhere or what? (Considered a multi-core system and some kind of common piece of memory)
- What will happen if the process has locked the memory change, and then it has fallen off? Does the OS remove the lok or what?
UPD: That is, in my understanding, once we can atomically change the value from 0 to 1, then this allows us somewhere to keep the information that process 1 has entered the critical area, but it needs after that, let's say, to perform 100,500 operations and after This is to get out of the critical area, but where is the information stored in which memory addresses is it going to change (its critical area) as a result of these 100,500 operations? Or stupidly just every team with LOCK # performed before the release?
If everything at the top sounds like nonsense, please explain how it actually works. :)
"объясните, пожалуйста, как это работает на самом деле"
."объясните, пожалуйста, как это работает на самом деле"
- avp