Operating system re-examination interview questions

These data are part sorted out on the basis of various chiefs read the article above, by reference.

1. were simply talk about processes and threads as well as their differences.

Process is the basic unit of allocation of system resources, he is a dynamic concept, is the first execution of an application process, and the thread of words is the basic unit of task scheduling and allocation is smaller than the process can be the basic unit operate independently. Thread process is equivalent to a smaller number, where a process can have multiple threads, and these threads can execute concurrently.

2. Thread synchronization options?

1.2 semaphore mutex critical section 3. 4 events

3. The communication process is what?

Divided into: 1 unknown named pipe conduit 2. 3. 4. shared semaphore message queue memory area 5. The
anonymous pipe: slow, limited capacity, for parent and child processes
named pipe: in any process can be transferred between the
shared memory area: the ability to easily control capacity, fast speed, but to keep pace, such a process at the time of writing, another process should pay attention to the issue of literacy, which is equivalent thread-safe threads, of course, can also be shared memory area used as communication between threads, but will not be necessary, inter-thread already has shared a piece of memory in the same process
semaphore: the main thing to realize synchronous
message queue: system capacity is limited, and the first time to pay attention to reading, to consider did not finish on a data problem

4. What is a deadlock? Conditions produced a deadlock?

During the process deadlock is running, there are two or more processes, a number of premises occupied before their own resources, the resources are not available for some of the constant requests, resulting in the overall system can not be propelled forward
created the conditions
1 . exclusive resource
2. resource inalienable
3. process the request and wait for
4 cycles waiting process

5. deadlock and hunger difference:

1. First, the biggest difference is that if the deadlock must involve two or more resources, and hunger may be one or multiple resources. 2. Under starvation, the system is at least one program can run smoothly, which may lead to deadlock the entire system can not run 3. deadlock must have happened circular wait, but not necessarily hungry. This also shows that resource allocation map can be detected by the presence or absence of deadlock, but it can not detect whether the process of starvation;

6. What are the process status?

1. 2. Run state ready state 3. blocking state
1. ready state: in addition to the process of processor resources other resources are ready
2. Run state: state of the process running on the processor
3. blocking state: Due Process some resources disappears or is preempted and down from the processor state

7. Paging and segmentation What is the difference?

1. The difference between the difference between physical and logical one and two dimensional 2. 3. The length difference is not fixed to the fixed
section is a logical unit of information, which is divided according to user's needs, so the segment is visible to users; pages are physical unit of information, in order to facilitate the management of the main memory and divided, is transparent to the user.
The segment size is not fixed, there is determined the completion of its function; fixed page size, determined by the system
to provide two-dimensional address space segment to the user; page provided to the user is a one-dimensional address space
segment is a logical unit of information for easy storage protection and information sharing, protection and sharing pages is limited.

8. The operating system process scheduling strategy, which has several?

FCFS 1. 2. 3. short operating priority round-robin priority 4. The priority higher response ratio feedback 6. multistage

9. Solution deadlock

Prevent deadlock and avoid deadlock, deadlock detection

10. What is the banker's algorithm

First of all to know why is it called the banker's algorithm, because the first is to deal with the issue of bank loans.
Bankers algorithm is one of the most representative of the deadlock avoidance algorithm. The method allows to avoid deadlocks in the process of dynamically apply resources, but the system prior to the allocation of resources should be the security of computing the allocation of resources, if the distribution does not cause the system to enter an unsafe state, the distribution, or wait.

11. preemptive and non-preemptive

It is reflected in the non-preemptive, when a process running on a processor, only their own circumstances arise, such as running or end the lack of resources required under the case will end, and will not interfere because of the emergence of other processes, and seize type is the time to processes running on the processor, when the condition occurs, the process is more suitable for running on the processor appear, it will be deprived of the use of the processor, and is replaced by another process.

12. What is interrupt

That is, the system stops processing the current instruction, sent away to deal with external processes at the local interrupt signal.

13. The principle of synchronization mechanism

1. Idle let into
2 busy waiting
3. Finite Waiting
4. to make the right to wait

14. The logical structure of files

1. The structured document: the file is recorded Formula
2. unstructured documents: i.e. streaming file

15. The operating system hard and symbolic links

Hard link, then that is shared index nodes to create a symbolic link is a link type of file, which stores the original file Address

Published 72 original articles · won praise 5 · Views 2829

Guess you like

Origin blog.csdn.net/qq_41115379/article/details/104840613