Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Linux run queue process scheduling     - SVN common commands (Linux)

- Source code to compile and install MySQL 5.7.9 (Database)

- How to manage your to-do list with the Go For It on Ubuntu (Linux)

- 5 tips to improve your Linux desktop security (Linux)

- Sublime Text 3 shortcuts summary (Linux)

- The Java utility, JavaMail (Programming)

- SQL statement to repair SQL Server database (Database)

- Setting Linux desktop environment, achieve HiDPI display support (Linux)

- Java eight new features 8 (Programming)

- Ten correct use Redis skills (Database)

- Oracle set and remove columns unavailable (Database)

- Ant command-line compiler Android project (Programming)

- CentOS 6.5 installation and simple configuration Nginx (Server)

- Gentoo: !!! existing preserved libs problem (Linux)

- Understanding the type in C ++ bitset (Programming)

- Differential test piece using MongoDB performance YCSB (Database)

- How to manage start-up applications in Ubuntu (Linux)

- How to use the on-screen keyboard in Linux (Linux)

- Oracle 11g tracking and monitoring system-level triggers to drop misuse (Database)

- Linux operating system security tools of the Logs (Linux)

  Linux run queue process scheduling
  Add Date : 2018-11-21      
  Run queue

When the Linux kernel to look for a new process to run on the CPU, you must consider only the process is runnable state (ie process TASK_RUNNING state), because the process of scanning the entire list is quite inefficient, so the introduction of the runs two-way circular linked list state of the process, also called the run queue (runqueue).

Run queue to accommodate the system can run all the processes, it is a two-way circular queue

The queue by task_struct structure pointer run_list two lists to maintain. Flag queue has two: one is "empty process" idle_task, a queue length.

There are two special processes in the run queue forever alone: ​​the current process and empty process. Earlier we discussed before, the current process is pointed to by the pointer cureent process that is currently running process, but please note, current pointer in the scheduling process (scheduler execution) does not make sense, why do you say? Before scheduling, the current process is running, when there is a scheduling opportunity sparked process scheduling, previously running process what state is unknown, in most cases in a wait state, so current at this time makes no sense, http: //Ubuntuone.cn/ until the scheduler selected a process put into operation, current really points to the currently running process; empty process is a special process that can only run the system does not process it will be executed, Linux run it as the head of the queue when the scheduler run queue traversal, from idle_task beginning to idle_task end, the scheduler is running, allowed to join the queue of runnable processes emerging, emerging runnable processes inserted into the tail, so that the benefits will not affect the members of the scheduler queue to be traversed, visible, idle_task is a very important sign of the run queue.

Another important symbol is the queue length, that is, the system can be run in a number of state (TASK_RUNNING) process, with a global integer variable nr_running representation, /kernel/fork.c defined in the following:

int nr_running = 1;

If nr_running is 0, it means that only empty queue process. Here to explain: If nr_running 0, the system of the current process and empty process is the same process. However, Linux will make full use of CPU and try to avoid this situation.
- Linux compiler installation Redis (Database)
- Virtual Judge environment to build and configure under Ubuntu (Server)
- Docker: Mirroring and container operations (Server)
- Linux crontab commands and detailed usage examples (Linux)
- xargs Detailed description (Linux)
- Based on OpenSSL for HTTPS service configuration (Server)
- VMware virtual machine Ubuntu install arm-linux-gcc cross-compiler environment (Linux)
- Binary Tree Traversal (Linux)
- Git you do not know about some of the things (Linux)
- Based on Python: OpenCV simple image manipulation (Programming)
- Java string equal size comparison (Programming)
- Java look and feel mode (Facade mode) (Programming)
- How to enhance the security of Linux systems (Linux)
- Install Websphere MB required system rpm package under Linux (Linux)
- Eight sorting algorithm implemented in Python (Programming)
- ORA-12547: TNS: lost contact error Solution (Database)
- Linux tmux tcpdump summary (Linux)
- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)
- Basic data types JavaScript type system and the type of packaging (Programming)
- How to configure MariaDB replication in CentOS Linux (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.