Interview common topic summary

Background: The backend python (Updating ...)

A. Inter-process communication

Five kinds :

1. Pipeline 

2. Named Pipes

3. Shared Memory

4. semaphore

The message queue

 

Second, the difference between processes and threads :

1. The process is the basic unit of the operating system resource allocation, and the thread is the basic unit of task scheduling and execution of

2. Memory allocation system allocates memory for each process , and is shared between threads of memory

3 .Costs for each process has its own memory space,large overhead when switching between processes,threads share memory

4. The process contains no thread relationship can be seen as a single thread , if there are multiple threads , then the process a number of lines execution , the thread is part of the process

 

Three deadlock condition :

1. mutually exclusive conditions resources can not be shared processes

2. The request has been keeping conditions resources processes can apply for a new resource again

3. Non-deprivation already allocated resources can not be forcibly deprived

4. A circular wait condition system composed of a number of process loop , the loop every process in an adjacent process is waiting for a resource occupied

 

Four deadlock prevention :

Failure condition 

 

Five .python garbage collection

Reference count-based recovery generational supplemented   space for time

Reference count : when the referenced object is created or passed as a parameter to be passed or vessel , reference count by one

When the object is explicitly destroyed (del) reference count by one is destroyed or be given a new name of the object reference or an object or objects out of scope of the element from the container or containers 

Generational Recovery : The memory is divided into three generations , 012 corresponding to the three lists , their survival over time the frequency of garbage collection object increases decreases , the newly created object will be allocated in the young generation , when the young generation of the list the total number reaches the upper limit , python garbage collection mechanism is triggered , the recovery of lost objects can be recycled , can not object to the recovery in years , and so on 

 

VI. Four waving three-way handshake

 

VII. Www.baidu.com in the address bar to the page showing what happened

 

 

other.

session and cookie and Differences

 

nginx proxy_pass Configuration

 

Guess you like

Origin www.cnblogs.com/cxl-blog/p/12457366.html