Q1. What is a critical section? What is the state of competition? What is synchronization?
A:
1) Critical regions are code segments for accessing and manipulating shared data. It is usually unsafe to access multiple resources concurrently with the same resource;
2) If two kernel tasks may be in the same critical section, it is an error phenomenon; if this happens, it is called a race condition;
3) Avoid concurrency and prevention The state of competition is called synchronization.
Q2. Briefly introduce deadlocks and ways to avoid deadlocks.
A: Deadlocks include deadlocks and ABBA deadlocks,
1) There are four reasons for deadlocks: exclusive use, non-preemption, request and hold, and loop wait;
2) The methods to avoid deadlocks are: destruction <;undistible<;conditions, destruction"request and hold"conditions, destruction "loop waiting" conditions.
Q3. What is the cause of concurrent execution in the kernel?
A: Concurrency" is divided into "pseudoconcurrency" and "true concurrency", and there are several reasons for concurrent execution in the kernel:
1 Interrupt: It may interrupt the currently executing code at any time;
2) Kernel preemption: Tasks in the kernel may be preempted by another task;
3) Sleep and its users Space synchronization: Processes executing in the kernel may sleep, which wakes up the scheduler and schedules a new user process execution;
4) Symmetric multiprocessing: two or more processors can execute simultaneously Code.
Q4. Give a definition of the semaphore and explain the meaning of down() and up().
A:
1) The semaphore in Linux is a sleep lock, which was proposed by Dijkstra in 1968. If a task tries to obtain a semaphore that has been held, The semaphore pushes it into the waiting queue and then lets it sleep; when the semaphore process releases the semaphore, a task in the waiting queue will be woken up, so that the semaphore can be obtained;
2) The semaphore supports two atomic operations P() and V(), the former is called the test operation, the latter is called the increase operation; later the system calls the two operations down() and up(); >
3) The down() operation requests a semaphore by decrementing the semaphore count by one; the up() operation is used to release the semaphore, which is also referred to as "up> (upping) semaphore Because it will increase the count value of the semaphore.
Get the NIC traffic through the 3rd party tool, this must be very clear. In fact, the effect can be
In order to ensure the normal operation of the Linux system and accurately solve various system prob
Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl
KVM: Kernel-based Virtual Machine is an open source virtualization solution based on the Linux kerne
Ecmal batch add stores (including partitions and permissions)
XXX is not in the sudoers file. This incident will be report
Time setting method under Linux operating system
Single-chip drive LED, digital tube, lcd display
How to let CentOS ban ping (anti-PING)
Linux screenshot command import use introduction
Yum install Tomcat basic tutorial
RS232/RS422/RS485 communication interface difference
Linux shell awk process control statement (if, for, while, do) details
Look at a Linux operating system command to understand a human civilization
WindowsXP shutdown failure full contact, Window XP operating system tutorial
Win7 window preview shows how to speed up?
Solve the problem of mounting lvm under Linux
Windows 2003 system uses SyGate agent to access the Internet fault
After the computer is turned on, the entire screen is green after a while
If Windows 7 has a system restore to heal the trick
Green Dam-Flower escort software closes and uninstalls common sense
Linux/centos solves Tomcat memory overflow
Win8 system personalized lock screen skills
How to use Windows7 Upgrade Advisor?
How to re-establish extended partitions for win7 system hard disk (unallocated disk)?