C # Writing a Windows service program

Source: Internet
Author: User
Tags amd processors

1.Windows Service Program

I don't quite understand the depth of the mystery in his absence when it comes to this problem. Later I learned that this is a long-running application, the service as long as the configuration automatically start when the Windows start automatically run, he has no interface. The ability to view and manage all the services that the system runs on a Windows machine through Administrative Tools/services. Most of the system's software and hardware health monitoring is through the Windows service to monitor, through the service constantly rotation to request the BIOS provided by the Port collection BIOS collected hardware running state. Maybe they're showing up in different mediums. As Windows counters perform performance indicators, Windows counters expose some externally callable interfaces (the Win32 function), and other third-party software does a better user experience to showcase the performance of the machine, such as the Master of Lu's computer monitoring. Said here I can not help but think of the composition of the computer, each computer hardware only need to provide a unified interface to the external, the underlying BIOS system rotation query calls each hardware provided interface, collect each hardware running state. Because Intel and AMD processors are publishing two interface solutions, the boards and Intel platforms on the market with AMD platforms are not interoperable.

2. When to set up a Windows service program

The Windows service we're going to build is not that complicated, it could be a timed task that starts executing at the point of time. If we want the program to automatically run fetch data at 12 o'clock every night for data aggregation, it's impossible to send someone to sit and wait, this is where our Windows service program functions, we set the program to 12:0 per day 0 automatically run this function to perform the corresponding data fetching and aggregation functions. Another one in a system to do an operation, the system needs to synchronize the data to the B system, if the matter is completely in the user's handling, it will inevitably lead to slow speed, in other thoughts we can use the automatic program to quickly check the timing of the frequency of changes in the data, If the detected data changes automatically enable a thread to synchronize (failed to try multiple times), anyway, do not affect or reduce the user's ease of use. The Windows service program is like a Sentinel. He is always monitoring the surrounding anomalies, and once found to meet the predetermined conditions will initiate the execution of the program.

3. Log logs, query automatic task execution status

Automatic task is no interface, can not be human-computer interaction. So if there is not a good log record, automatic task failure or exception to locate the exception is not an easy thing to do. So in the automatic task writing we should join a good logging method, log the way arbitrary, can record the database log, text file log and system log, as long as these logs can be easily managed and used to query the problem of automatic program to achieve the purpose of logging.

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

Many people think that the automatic program is good, because there are many things that can be handled automatically without human involvement, such as data capture analysis. But in a company the automatic procedures should have a strict control and deployment of supervision, will develop a lot of automatic tasks to deal with those long-time operation of these things and do not need people to participate in things. At this time in our architecture design must clearly record which automatic task deployed on those servers, if the record is not detailed in the system later maintenance or migration may forget to uninstall or forget to load some automatic tasks, and these automatic tasks directly affect our entire system's normal operation. So the installation deployment is accurate and the records of those deployments are guaranteed to be 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.