The CPU context switching theory section (a)

The CPU context switching theory section (a)

  • 1. What is the context?
    A: The context is composed of CPU registers and the program counter

  • Why 2.CPU context switching?
    One CPU context switching, is to ensure Linux system to work the core functions: A

  • 3. What is the CPU context switching?
    A: CPU context switching, is a first front CPU context saved task, the new task and the context is loaded into these registers and program counter, and finally jump to a new location within the meaning of the program counter, the task operation

  • 4. What is the cpu register?
    A: cpu cpu registers are built very small, but fast memory

  • 5. What is the program counter?
    A: It is used to store the CPU is executing a command position, or the position of the next instruction to be executed

  • Where 6.cpu saved context is stored in?
    A: stored in the system kernel

  • 7. What operating system management tasks?
    A: Processes and Threads

  • 8.cpu context switching What scene?
    A: The process context switching thread context switching, interrupt context switching

  • What 9.ring0 and ring3 are?
    A: ring0 is kernel mode, ring3 is user mode

  • 10. privileged mode switching is carried out by what is done?
    A: The system calls

  • 11. What steps privileged mode switch is?
    A: CPU registers the original user instructions need to be saved, in order to perform kernel mode code is, CPU registers need to be updated to the new position kernel mode instructions, and finally jump to the kernel running kernel tasks

  • 12. The once privileged CPU mode switch occurs a few times a context switch?
    A: 2

  • 13. What is the process context switch?
    A: it refers to the switch from one process to another

  • 14. The process context switch is switched to the privileged mode What is the difference?
    A: The process context switch refers to a process to switch to another process
    privileged mode switching is always running in the same process

  • 15. When will the process of switching contexts?
    A: Only in the process of scheduling only need to switch context

  • 16. When will the process is scheduled to run on the CPU?
    A:
    (1) When a process time slice is exhausted
    (2) process in insufficient system resources
    when (3) when the initiative process hangs by SLEEP
    (4) when there is a higher priority process is running

  • 17. What is the process?
    A: The process is the basic unit of scheduling

  • 18. What is the thread?
    A: The thread is the basic unit of resource owners

  • 19. What is the biggest difference between threads and processes are?
    A:
    (1) When the process has only one thread, the process can be considered equal to the thread
    (2) when a process has multiple threads that share the same virtual memory and global variables and other resources. These resources context switching is not required to modify

  • 20. The thread context switching, which has several situations?
    A: The thread does not belong to the same before and after the process, before and after the threads of the same process

  • 21. What is the interrupt context switching?
    A: In order to quickly respond to hardware events, interrupt handling interrupts the normal process of scheduling and execution

NOTE: What reduce context switching techniques cases?
A: The database connection pool (Multiple Access), a reasonable application of the process of setting the maximum number of threads, direct memory access DMA, zero-copy technology

Guess you like

Origin blog.51cto.com/13229718/2431541