Two-horse driving thread car

Source: Internet
Author: User

In the process of processing data collection, the most common practice is to use the channel loop-driven protocol, and then let the Protocol send and receive data through the device. This method is not suitable for large systems. It will make the system inefficient, especially when reading and writing serial ports, affecting the system's real-time response speed. Another approach is to generate a process for each channel to avoid inefficiency caused by channel polling. The disadvantage of this approach is to exchange space resources of the operating system for efficiency.

This article proposes a concurrent processing process. The technical solution is for reference only. Two horse driving thread car: one horse is the protocol processing thread, and the other is the device processing thread. Under the joint drive of the two horses, the channel and the living body of the Protocol will start up. Each channel is allocated with a "sending zone" and a "receiving zone". The device includes a serial port, Ethernet, and CANbus. The Protocol includes Modbus, iec101/103/104, and so on. The device sends the data in the "sending zone" to the driver buffer zone through the device driver interface of the operating system, and stores the data received by the device in the "receiving zone, through corresponding rules, the Protocol fills in the corresponding received data in the raw data sharing area.

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.