Friday, May 31, 2013

Operating system some of the important concepts

Process synchronization (direct constraints):
Synchronization refers to the system of some processes need to cooperate together to complete a task . Specifically, a process to run to a certain point, the process for it to require the other partners to provide information without the prior messages, the process waits to get the message into the ready state after awakening. Synchronization means on the basis of mutually exclusive (in most cases), through other mechanisms visitor ordered access to the resource. In most cases, the mutex synchronization has been achieved, in particular all resources must be written to mutually exclusive. Few cases is one that can allow visitors to simultaneously access multiple resources.

Process mutex (indirect constraints) Mutual Exclusion:
Since each process requires the sharing of resources, while some resources require exclusive use, so competition between processes use these resources, the process of this relationship is mutually exclusive processes. A resource while allowing only be accessed by a visitor, unique and exclusive. But can not restrict visitors exclusive access to resources in order that access is disordered.

Related concepts:
Mutually exclusive: that multiple processes can not simultaneously use the same resources.
Deadlock: refers to the number of processes to each other, are not enough resources.
Hunger: refers to a process has been lack of resources (other processes may in turn consume resources).
Critical resource: the system allows only certain resources used by a process, known as the critical resources such resources or resources or shared variables mutually exclusive.
Critical area: the process of accessing critical resources section of code.

Critical Areas:

  • Critical region (Critical Section): The process to access critical resources section of code.
  • Entry zone (entry Section): Before entering the critical section, check the possibility of entering the critical section of code. If you can enter the critical region, usually set the corresponding " critical region is being accessed " flag
  • Exit area (Exit Section): Used to " critical region is being accessed " flag is cleared.
  • Residual area (remainder Section): The rest of the code.



Use critical areas should follow the guidelines
Available let into: When no process in the critical zone, any right to use the process to enter the critical section.
No empty wait: Do not allow more than two processes simultaneously enter the critical region.
Choose one of many: When there is no progress in the critical areas, while there are multiple processes required to enter the critical region, only let one of them to enter the critical section, other processes must wait.
Finite Waiting: Any request to enter the critical section should be met within a limited time.
Let right wait: in a wait state process should give up occupation of CPU.
Equal competition: no right to stop any process other processes running processes relative speed between no hard and fast rules.

 Linux under the process contains the following key elements:
There is a executable program;
A dedicated system stack space;
Kernel has its control block (process control block), describing the resources occupied by the process, so that the process can accept the kernel scheduler;
Has a separate storage space
Processes and threads sometimes not fully distinguish between, often depending on the context to understand its meaning.

No comments:

Post a Comment