Operating Systems - Q & A notes in class exercises answer 14--

Learning video class notes from the operating system
Description: Others "Q & A notes in class," also "Operating System" column

【4-1】

This lesson after-school discussion summary:

  1. What is a safe state? Security sequence? Why there is a security sequence system deadlock will not occur? If there is a security sequence, then the sequence is the only security of it?
    A: If the current state of the existence of a safe sequence of the current state is the state of security; security sequence is represented by the sequence of the process in order to allocate resources, system deadlock will not occur; series because of security needs are a variety of resources per process maximum allocation of resources to the process, according to the process of allocating resources to the maximum so that each process can be successfully executed, that is certainly each process can be successfully completed during the actual process of advancing the process (as in performing the actual process, each of its resource requirements also need not necessarily be the maximum number of resources, such as: the need to complete the process P1 required to perform 5 printer, then the next breath may apply for five printer resource application, it could be any less than a 5 value; or that these five printer application may be completed once the application is also possible in multiple applications; breath complete application no problem, no problem even multiple times); if there is safety sequence, sequence is not safe must be unique in the exercises we do bankers algorithm will often encounter when security sequence is not the only case.

  2. What is the use of the banker's algorithm idea (prevention deadlock? Avoid deadlock? Detect deadlocks? Relieve the deadlock?) Deal with the deadlock?
    A: bankers avoid deadlock algorithm is to use the idea to handle deadlock. The lesson to break the four necessary conditions for deadlock in three (recall the four necessary conditions for deadlock is what? Mutually exclusive conditions, not deprivation, request and keep the conditions, circular wait condition) is the idea of prevention deadlock ; simplify resource allocation map is to detect deadlocks ideas; how-to videos to lift the deadlock did not say, mainly two methods: to seize the resources (the process into a deadlock forced deprivation of resources for distribution to other processes, namely single-plank bridge at the first exit in someone, let someone else go first), termination (or withdrawal) process (that is, to kill a process that takes natural resources will be released).
    Deadlock should be treated in accordance with: the prevention of deadlock -> avoid deadlock -> detect deadlocks -> process deadlock were released, the first two are in advance, after the latter two is that a deadlock will begin to find ways to killed in the bud, if the deadlock is inevitable will happen, then consider the next step how to detect deadlocks and how to lift the deadlock.

  3. Bankers algorithm is the focus of today, there will be after-school exercises, examinations may all have this problem, I remember drawing table when problem-solving, or only a portion of points! In addition to this is no longer the subject, please their own after-school practice.
    A: The table every step two: resource allocation table and safety checklists. In addition, each table matrix (vector) Meaning:
    Number Allocation matrix representation of each process and has been (or already assigned) of various resources;; Max matrix representation of the processes require the maximum number of resources Need: resource allocation table matrix representation of the processes required number of resources; Available vector represents the number of resources currently idle.
    Security check table: Work matrix representation is the number after each allocation of resources available, the initial (first row) equals Available vector, from the second line is equal to the start line Work + Available; Need matrix and Allocation content and resource allocation matrix tables are the same; Work + available represents the number of all available resources of the current process is completed.

  4. Review the hierarchy of memory? Meaning the process of memory management (memory management) understand the program into?
    A: memory hierarchy in descending order: a register, cache, main memory (RAM), secondary memory (external memory), and the descending speed of small to large capacity, the purpose of the hierarchy is to alleviate the speed and capacity contradictions.
    Memory management (unless otherwise specified refers to the memory management, external memory management on the back of the device management section). Run any program must be loaded into memory to execute, understand the process of loading a program, then you know how this shared memory resources are allocated to the various programs, including the main contents of memory management: memory allocation, address translation (mapping ), memory protection, memory expansion (virtual memory, the next chapter of content).

  5. How to understand the logical address and physical address?
    A: Physical Address: the memory as a two rows of small spaces (small spaces each one byte: 1B = 8bit, also called a cell); unit 0, unit 1, unit 2, unit 3, ... (Note numbered from 0) is the physical address of the memory, this is a one-dimensional linear address can not be changed to.
    Logical address: required storage space 6 spaces Suppose you need to write programs or six storage spaces (i.e., 6 bytes or 6 units) while loading the program, but the first memory unit 10 (or more front number of units, not necessarily 10) are accounted for, then you can only program from the physical address of the unit 10 starts loading (note numbered from 0), but your program thought that the physical address is 10 units their addresses 0 - 0 is the logical address (logical address of each program note are numbered from 0), the No. 1 corresponding to the logical address after the physical address 11, and so on. The logical address 0 is converted to a physical address 10, which is an address conversion (mapping).
    Imagine, as a class to your program, your student number is the logical address of the program, to the classroom to go to school is the first performance (to the classroom is to program into memory) program, you seat number in the classroom is a physical address, which position is to sit down and find someone address mapping.

supplement:

Any logical address of a program are numbered starting from 0, the contents of the first byte 0 is the beginning of the program, and then so on. Examples of student number is not necessarily, because the student number is edited by a professional, it is a first class a student is not necessarily the number 0 (of course, student number is starting from 1 series)

Published 94 original articles · won praise 40 · views 30000 +

Guess you like

Origin blog.csdn.net/weixin_46218781/article/details/105381133