Linux is a real-time system or a time-sharing operating system __linux

Source: Internet
Author: User
Real-time operating system real-time operating system operating system, referred to as RTOS. 1. Real-time operating system definition of real-time operating system (RTOS) refers to when the external event or data generation, acceptable and fast enough to handle, the results of processing can be within the specified time to control the production process or respond to the processing system, and control all real-time tasks coordinated operation of the operating system. Therefore, providing timely response and high reliability is the main feature. Real-time operating system has hard real-time and soft real-time points, solid requirements in the specified time to complete the operation, which is guaranteed in the design of the operating system, soft real-time, as long as the priority of the task, as soon as possible to complete the operation.
  The operating system we normally use can become a real-time operating system after a certain change. A real-time operating system is an operating system that guarantees specific functionality within a certain time limit. For example, you can design an operating system to ensure that a robot on a production line can acquire an object. In a "hard" real-time operating system, the operating system will end up with errors if it is not possible to complete the calculation of the object within the allowed time. In the "soft" real-time operating system, the production line can still continue to work, but the output of the product will not be allowed to arrive within the allowable time to slow down, which makes the robot has a short production phenomenon. Some real-time operating systems are designed for specific applications and others are generic. Some common-purpose operating systems call themselves real-time operating systems. But to some extent, most general-purpose operating systems, such as Microsoft's Windows NT or IBM's os/390, have features of real-time systems.
  This means that even if an operating system is not a strict real-time system, they can solve some of the real-time application problems.
  2. Features of real-time operating systems 1 multitasking; 2 thread priority 3) a variety of interrupt-level embedded operating systems often require real-time operating systems, the kernel to meet the requirements of real-time operating systems. 3. Real-time operating system related concepts (1) Basic Concept Code critical section: refers to the processing of the inseparable code. Once this part of the code begins execution, no interrupt is allowed; resource: Any entity that is occupied by a task; a shared resource: a resource that can be used by more than one task; tasks: Also called a thread, is a simple program. Each task is given a certain priority, with its own set of CPU registers and its own stack space. Typically, each task is an infinite loop, each task is in the following five states: Dormant state, ready state, running state, suspend state, interrupted state; task switching: Saves the current state of the running task (all content in the CPU register) in the task's own stack area, Then reload the current state of the next task that is to be run from the stack of the task to the CPU's register and openThe running of the next task; The kernel: Responsible for managing each task, assigning CPU time to each task, and responsible for communication between tasks. Can be divided into the kernel of the deprivation kernel; dispatch: One of the main responsibilities of the kernel, deciding which task to run. Generally based on priority scheduling method; (2) Priority task priority: the static priority and the dynamic priority can be changed by priority; priority inversion: priority inversion is the most frequently occurring problem in real-time systems. The allocation of shared resources can result in lower priority tasks running first, after high-priority tasks.
  The solution is to use the "Priority inheritance" algorithm to temporarily change task priority to curb priority inversion. (3) Mutual exclusion although shared data areas simplify the exchange of information between tasks, it is important to ensure that each task is exclusive when it handles shared shared data.
  The general method of satisfying mutually exclusive conditions is: off interrupt, use test and position instruction (TAS), prohibit task switching, use signal quantity. Because the significance of using real-time operating system is to be able to deal with a variety of unexpected events in time, that is, to deal with various interruptions, thus measuring the embedded real-time operating system of the most important, most representative performance index parameters should be interrupted response time.
  Interrupt response time is usually defined as: interrupt response time = Interrupt Latency + Time to save CPU State + The kernel's ISR into the function's execution time [2].

Interrupt delay Time =max (maximum time of interruption, maximum instruction time) + time to begin executing the first instruction of the ISR [2]. --------------------------------------------------------------------------------------------------------------- -----------time-sharing Operating System "words": time-sharing operating System "phonetic": fēn shícāo Zuòxìtǒng "English": time-sharing Operating System "interpretation": so that a computer at the same time for several, dozens of An operating system that serves even hundreds of users. Connect the computer with many end users, time-sharing operating system will be the system processor time and memory space at a certain time interval, alternately switch to the end user's program to use. Because the time interval is very short, each user feels like he has exclusive computer. The characteristic of time-sharing operating system is that it can effectively increase the utilization rate of resources.
  UNIX systems, for example, use a stripped dynamic-priority CPU dispatch, which strongly supports time-sharing operations. The generation of time-sharing system is a new type of OS which is formed to meet the needs of users. Between it and the multi-channel batch processing system, hasDistinct performance differences. 
  The user's needs are embodied in the following aspects: human-machine interactive sharing host is convenient for users to the basic idea of time-sharing system: The computer system resources (especially CPU time) for the time division, each time period is called a time slice, each user in turn use the time slice. 
  Time-Sharing Technology: The operating time of the processor is divided into a very short time slice, in turn, the processor is divided into various online operations by the time slice. time-sharing operating system: an online multi-user interactive operating system. The general use of time-slice rotation to make a computer for multiple Terminal Services. 
  Ensures fast enough response time for each user and provides interactive session capability. 
  Design Objective: To respond to the user's request in time, and to maximize the utilization of the system resources if possible. 
  Suitable for office automation, teaching and business processing, such as to ask for opportunities to talk to the occasion. 
  Working mode: A host connected to a number of terminals; Each terminal has a user in use, interactively to the system to make a command request, the system accepts each user's command, uses the time slice rotation method processing service request, and through the interactive way displays the result to the user in the terminal; The key problem in the realization of time-sharing system: receiving in time. 
  Timely processing. 
  Features: Interactive: User and system for Man-machine conversation. 
  Multiplexing: Multiple users simultaneously use the same CPU on their terminals. 
  Independence: Users can operate independently of each other, mutual interference, and not confuse each other. 
  Timeliness: Users in a short period of time can be a timely response to the system.

Factors that affect response time: The number of terminals, the size of the time slice, the amount of information exchanged, the speed of information exchange. 

------------------------------------------------------------------------------------------------------------Examples: Time-Sharing-now popular PC, the server is the use of this mode of operation, that is, the operation of the CPU into a number of pieces of time to deal with different operational requirements real-time--generally used on single-chip, such as the elevator upper and lower control, for buttons and other action requirements for real-time processing Linux is time-sharing system,
But can be changed to real time, such as: Ucos is the Linux modified real-time system, as for their differences, the following to quote a similar answer in Baidu, personal feeling simple and clear: "Time-Sharing system is a system can be two or more than two account services." A real-time system is an operating system that responds to instructions immediately. Microsoft's common system does not. and also crashed. The operating system in a fighter plane is a real-time one, and think about what it would be like if someone was fightingThe computer responds to the pilot's previous instruction or freezes, who dares to drive the plane. ”

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.