Answer the question
In order to leave comments, you need to log in
Where are the variables that processes access before entering the critical section stored?
I have a rather chaotic question today, gentlemen.
I am in the process of reading Tanenbaum's "Modern OS", in the section "Interaction of processes" the author discusses the method of achieving mutual exclusion of processes ( interrupt prohibition, blocking variables, strict interleaving ). If the idea of disabling interrupts is more or less clear, then confusion begins with the use of variables.
Excerpt from the book:
As a second attempt, consider a software solution that uses
a single shared (blocking) variable whose initial value is zero. When
a process needs to enter its critical region, it first checks the value of the
blocking variable. If it is 0, the process sets it to 1 and enters
the critical region. If the value is already 1, the process simply waits until it
becomes zero. Thus, a value of zero indicates that none of the
processes is in its critical region, and a value of one indicates that some process
is in its critical region.
Answer the question
In order to leave comments, you need to log in
I am in the process of reading Tanenbaum's "Modern OS",
Below we are talking about Windows.
Some terminology: CriticalSection is an object that can only be used within one process. Mutex is a named object and can be used to communicate between processes.
Further, there are special APIs for working with a section and Mutex, which hide implementation details, so there is no problem of access to a foreign process. A section can certainly be stored in the memory of its process: on the stack or in the "normal" address space.
Alternatively, there may be shared memory between processes. It's about a simple situation.
If we talk about some complex resource, then it is controlled by the OS or the corresponding driver and the process asks the possibility of obtaining a resource from it through an API or a system call.
I hope I understood the question correctly and was able to answer it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question