This paper analyzes the multi-threaded synchronization mechanism and synchronization objects of the Windows NT operating system. Taking its application in the development of synchronous communication programs for detectors and theodolites as an example, this paper discusses how to achieve synchronous communication between applications and device drivers through shared events, and gives the implementation principle and specific writing steps of synchronous drivers. Keywords: multi-threading; synchronization object; Windows NT; device driver The conventional communication between applications and drivers is achieved through functions such as the driver reserved interface ioctl, and the driver writers also take it as their responsibility to implement these calls. However, in some cases, just completing these calls cannot meet the real needs of users. For example, the application needs to know the interrupt status of the underlying hardware at any time so as to make corresponding processing. Since Windows NT prohibits applications from directly accessing hardware interrupts, it is necessary to use device drivers to intercept hardware interrupts across the operating system boundary to achieve synchronous communication between user programs and drivers. To complete this synchronous communication, it is necessary to use multi-threaded synchronization objects, that is, to use Event events to achieve communication between the two. The detector is an instrument used to detect the field working status of the theodolite and solve the system tracking accuracy. It simulates the central computer to send guidance data to the theodolite, and receives the measured data from the theodolite at the same time to detect whether the theodolite is working properly. The detector has a built-in time synchronization card, which provides a 20Hz interrupt synchronization signal. The detector and the theodolite communicate synchronously at this frequency. Therefore, this article introduces in detail how to use the shared event mechanism to write the bottom-level driver, and promptly notify the upper-level application of the 20Hz interrupt signal provided by the time synchronization card to complete the synchronous communication between the detector and the theodolite.
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore