I have just tasted a real time system in college, the work of these years has not been exposed to such knowledge, has been forgotten almost, with the impression that the things learned at that time.
Real-time systems are very different from the systems we normally use. Real time system has soft real-time and hard real-time points, soft real-time is applied to if the failure of a task does not immediately cause property loss or personal injury or loss is acceptable, and hard if the failure of the task will result in property loss or personal injury and other unacceptable major accidents, it can be seen, Soft real-time is mainly used in commercial and industrial, hard real-time system should be used in military and personal security equivalent areas such as civil aviation.
A notable feature of real-time systems is that any task must be completed within the specified time, one of the tasks here is the execution of the process, it differs from the Non-real-time system is the task scheduling algorithm, the task of the Non-real-time system is based on priority scheduling, such as a number of suspended threads, The operating system calculates the priority of different tasks based on various algorithms (some are fixed-time slices, there are also the shortest first, or the longest priority, so that they are queued to perform according to priority, each task to run a certain amount of time after the suspension of the next task, of course, this is for a single CPU. The real-time system will arrange the task queue according to the end time of the task, and get the most CPU time for the task closest to the deadline. Of course, it can be considered that the algorithm of real-time system is a special priority algorithm.
Although the shortest priority algorithm in the non real time system is very close to the idea of real time system, but it is worth mentioning that, in real-time systems, the scheduling thread is enforced, that is, regardless of whether the current task CP time is used up, every time (this time is a fixed value), will run a scheduling thread, such as, Run 5 milliseconds every 100 milliseconds, and when the time is up, the scheduler is forced to switch to the scheduling process, where the scheduling process will reorder the existing tasks while it is running. Therefore, in theory, the real-time system will never crash.