We need the fault tolerance of the program itself.

Source: Internet
Author: User
We need the fault tolerance of the program itself-general Linux technology-Linux programming and kernel information. The following is a detailed description. We have two principles to design a program:
1. We should try to minimize errors in our programs.
2. Our program should be correctly executed if there are any errors.

The first article may be easy to understand, and many people may not realize the necessity of the second article. Simply put, it is the fault tolerance of the program. Program Fault Tolerance includes the detection of input and output errors, which is a fault tolerance to the outside world. As we all know, I think it should also contain the fault tolerance of program design errors.

A small program may be able to ensure that there are no errors. For a large program, no one can ensure that there are no errors in their own program. The solution is to fault tolerance your program errors.
Of course, I am not saying that exceptions are used to ensure the normal operation of our programs. It is better to directly handle some errors that can be encountered. It seems that you do not have a thorough understanding of exception handling. exceptions do not have to be accurate to which command can be processed. Otherwise, it may be useless for general programmers to handle exceptions, for C and C ++ programmers, they have no idea what commands their Code corresponds.

In fact, this is not to say that the requirements for writing kernel programmers are relaxed. On the contrary, it is more strict. We need to minimize or even eliminate errors when writing programs, but we need to consider how to handle errors in our design. This is a good system solution. This is what a good system designer should consider.

The original design of a single-chip cpu has these considerations, because once the CPU is fixed, the program in it cannot be modified, then any small error is fatal (this is only a financial loss ), therefore, the handling of program errors is fully considered in the design scheme. This may be understood by people who want to implement control system programs, such as small-to-elevator systems and large-to-satellite systems that have strict program requirements, but also consider program recovery after external interference, etc, this is because if the system crashes, it may be a matter of destiny. The development direction of these linux systems must be embedded into the operating system.
Related Article

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.