C # compile a Windows Service Program

Source: Internet
Author: User
Tags amd processors

1. Windows service programs

I don't quite understand the profound meaning in this case. Later, I learned that this is an application that can run for a long time. This service only needs to be configured to automatically start when windows is started up, and there is no interface for it. You can view and manage all services running in the system through management tools/services on Windows machines. The operating status of most software and hardware in the system is monitored through the Windows service. The service is continuously trained to request the port provided by the BIOS to collect the running status of the hardware collected by the BIOS. They may display performance indicators in different media, such as windows counters. windows counters expose some interfaces (win32 functions) that can be called externally ), other third-party software provides a better user experience to demonstrate the machine's performance, such as computer monitoring conducted by Master Lu. I can't help but think of the composition of the computer. Every hardware of the computer only needs to provide an interface in a unified format to the outside, and the underlying BIOS system performs round training query to call the interface provided by each hardware, collect the running status of each hardware. Because Intel and AMD processors have published two sets of interface solutions, the motherboard of the AMD platform and the motherboard of the Intel Platform on the market cannot be used together.

2. When to create a Windows Service Program

The Windows service we want to build is not that complicated. It may be a scheduled task that starts to run at the time. If we want the program to automatically run the capture data at every night for data aggregation, it is impossible to send a person to sit where to wait, this is where our windows service program functions. In the program, we set to automatically run this function at every day to execute the corresponding data capture and aggregation functions. Another operation is performed in a system. The system needs to synchronize data to system B. If this operation is performed completely during user operations, the speed will inevitably slow down, in another way, we can use an automatic program to quickly detect data changes at a scheduled frequency, if data changes are detected, a thread is automatically enabled for synchronization (multiple attempts can be performed if a failure occurs), it should not affect or reduce the user's ease of use. A windows service program is like a sentinel who monitors exceptions at any time. Once it finds that it has reached the predefined conditions, it will start the program to execute.

3. record logs and query the execution status of automatic tasks

There is no interface for automatic tasks and human-computer interaction is not allowed. If there is no good log record, it is not easy to advise if the automatic task fails or an exception occurs. Therefore, we should add a good log record method in automatic task writing, which can record database logs, text file logs, and system logs, as long as these logs can be easily managed and used to query automatic programs, the purpose of logging is achieved.

4. How to set up a good automatic task to serve the entire system?

Many people think that automatic programs are good, because they will automatically process tasks such as data capture and analysis without human intervention. However, automatic programs in a company should have strict control and deployment supervision, it will develop many automatic tasks to handle those tasks that take a long time and do not require human intervention. In this case, when designing our architecture, we must clearly record which automatic task is deployed on those servers, if the record is not detailed in the later maintenance or migration of the system, you may forget to detach or load some automatic tasks, which directly affect the normal operation of the entire system. Therefore, install and deploy accurately and ensure that these deployment records are updated in real time.


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.