My review of the operating system - Overview and Process Management

review

  Some of the views about computer operating system: in fact, nothing more than a computer hardware integration, and people to be more convenient for computer orders and allow the computer to carry out these orders, in the beginning of computer development, was also no operating system , people orders to the computer, or get the results from your computer, all the way with paper and then translate this approach is too complicated, and the efficiency is relatively low, since recorded history, the world's first the operating system is GM-NAA I / O operating system, the operating system can perform a batch process, after a process that is finished you can go to the next process, the operating system also provides a uniform interface to share, in fact, the most commonly used operating system is the number of people using the operating system is most Windows operating systems, Linux , UNIX only some of the development operation and maintenance personnel will play this in depth, but the Linux operating system, in fact, is great, very fast, For example, I'm using the deepin operating system.

[Process Manager]

Process is the most basic concept of the operating system, and the process is the basic unit of resource allocation, and the process can be a mess of many threads, or understood as a lightweight image into such relatively few, and the execution of the thread is in kernel mode execution, and with or without the introduction of the concept of threads, processes are the basic unit of resource allocation, the process is an abstract concept, or you can understand the process that the computer program is running, it is assumed in the Windows operating system environment we open the Explorer:

 

You will find that, after the stage there are many programs that are running, when the mobile phone operating system - also known as an embedded operating system, in general, will support open management daemon, you turn on the interface at this time App is running process, when the process executing on a computer is also divided into user mode and kernel mode, user mode is equivalent to the computer you open the program above, kernel mode is that you issue a command, or a system call or interrupt processing , the CPU will enter into kernel mode to handle your order, here it is necessary to talk about the core concepts.

[Core]

When composing the modern computer, when you buy a computer, often hear the core of this argument, this time you have to tell the difference this is true or false core core (thread count), take the cpu view, cpu is a hardware integration stuff, you put the cpu apart and you will find a cpu is divided into multiple cores, this division is divided physically, and operating system independent, and based on different operating systems on the allocation algorithm can also design how many processes are assigned to different cores above.

[ EXample ]: Suppose cpu is 4 core, this time to the 10 threads, depending on the assignment, assigning threads to be run on all of the core, but the OS certainly for performance reasons will choose the best allocation strategy.

In fact, check the computer cpu there is a simple method and the core threads:

  1. win + R open control command
  2. Enter wmic
  3. Use this menu:

 

 

 

  1. Enter " the CPU GET " command

Then you can see the cpu cores and some other parameters:

 

 

 

(Whisper: computer too much garbage)

 

The kernel is a physical device running threads, but decided a number of how many threads on top of the kernel can run this can be artificially controlled, so there have to say how much the core of the market is in fact the number of threads to deceive consumers.

Relations continue to talk about the process below, modern computers are more complicated process with the implementation, which led to a problem, the computer has a lot of progress, but only allows a process on processor for processing (Generally speaking, of course, and more processor case, the difference between the processor and wherein the processor, the processor comprising a processor, the processor and the external device constitute a computer), and determines the order of processing for these processes tend to affect the performance of the computer, which it leads to the concept of scheduling:

There are three general schedule (divided according to the scheduling levels):

  1. Job Scheduling
  2. Memory scheduling
  3. Scheduling process

Depending on the scheduling levels, scheduling strategy are also different, there are several common scheduling algorithms:

  1. Short operating priority: in fact, is to see the job run time on the processor, which time a job is shorter, which let the processor, but this will lead to a drawback: if there have been on the job a short processor running, delay in operation for a long time to run on the processor, which makes occurred hungry.
  2. First come, first served: As the name suggests, a job which is first come, according to the order of execution of the job, but considering down only conducive cpu busy but not conducive to Io busy.
  3. Priority scheduling algorithm (static): According to the ready queue processes, set priorities ahead of good process, when the processor is running in the process, the priority is not any change.
  4. Higher response ratio scheduling algorithm:

Response ratio P = (waiting time + required time and services) / (service time requirement)

In fact, this algorithm taking into account the short and long operation to achieve a working balance.

Hunger does not occur.

  1. Multilevel feedback
  2. Round-robin algorithm: Ready for each process on the queue, are set to a fixed time, the processor runs at a fixed time on this course, when the time on the time slice runs out, regardless of the process there is no end runs, It becomes a ready state, so that the next process processor be running.

[Synchronous and mutually exclusive processes]

Is synchronized in terms of the process, to make a very simple example: Let's say you go to dinner, you give money to the cashier (giving money to spend money on this process is equivalent to passing a buffer), then you can get a meal, We reached a dinner this demand.

The exclusive simpler: just like in a lot of people on the toilet outdoors, but this toilet allows only one to enter. This is the concept mutually exclusive.

[Deadlock]

With the process of mutual exclusion and synchronization concepts, we talk about the concept of deadlock, to give an example:

Suppose there are two people and 5 sugar, everyone needs three sugar will leave the store, but the store is not empty and only after they ate a new sugar will do, now everyone hands of two sugar , it's just one will go, but do not eat sugar in their hands, which occurred in a deadlock.

The concept summary of textbooks summarize some of the more: been a stalemate because multiple processes competing for resources caused by (wait), if there is no external force (such as the revocation off certain processes), these processes have no way to continue execution.

[ Cause ] : Deadlock necessary conditions:

  1. Circular wait
  2. Exclusive
  3. Request and hold
  4. Do not deprive

A necessary condition for the start of the deadlock, the destruction of which could destroy a deadlock, but it also begs the question, if every time and then processed after the deadlock appear a bit too trouble some, there a can determine in advance the process of the implementation of the order, this order will certainly deadlock will not occur, which leads to a new algorithm - bankers algorithm

[Note]; bankers algorithm is an algorithm deadlock prevention

Here is an example on a Wang book:

 

 

 

And the current operating system has a number of resource A = ( . 3 , . 3 , 2 )

Claim1

We begin with a max Matrix - Allocation to a matrix need matrix as follows:

 

  Comparison of vector A we know meet p1 and p3 process needs

Assumption is p1 met. With ( 3 , 3 , 2 ) + ( 2 , 0 , 0 ) = ( 5 , 3 , 2 )

This process has been circulating a security sequence: p1 p3 P4 P2 P0

It will not perform the deadlock continues in that order.

 

 

 

remark】:

Overall, the operating system process management plays a vital role, in conjunction with what computer composition principle here to talk about process management, we all know that our computers are time-division multiplexing computer, that is, in one clock cycle by executing different instructions for different programs to achieve the macro appears to be executed on a computer together, but in fact is a one to execute the program in the implementation process is the process, process management through the factory when packed policy or is artificial to set some kind of process management algorithms to him, along with the cpu to enhance the performance of the computer together.

Guess you like

Origin www.cnblogs.com/dfxdd/p/11617360.html
Recommended