Asynchronous transmission mode in Linux and proactor mode in Ace

Source: Internet
Author: User

The Reactor works in synchronous mode and the Proactor works in asynchronous mode. High-performance servers must work in asynchronous mode. Therefore, ACE has the Proactor class group. ACE features cross-platform and blocking of technical details. Proactor should write a piece of code that can run on Linux, Windows, and other operating systems. In actual development, we found that the service program compiled by Proactor works very normally in Windows and does not work normally in Linux with kernel 2.6.X. For example, the customer's Connect operation cannot be returned. After check, the write and read operations must appear in pairs to work normally. That is to say, if a server is registered with the management server, the Management Server occasionally sends control commands to sub-servers, which cannot be implemented. This is fatal.
After research, it is found that the Proactor in ACE is an Asynchronous Operation implemented using the Posix standard on Unix. There is an AIO in Posix, And the Proactor uses AIO for asynchronous transmission. However, Linux does not support AIO in versions earlier than 2.6, while later versions support AIO. As this part supports, the Posix subclass cannot work normally.
After investigation, ACE developers knew the situation, but they did not take any measures. Think about it for yourself. The Unix platform has more than one Linux, and Linux supports Posix standards. This solution is idealistic. Linux will also support Posix sooner or later. In this case, ACE developers propose a solution, namely TProactor, which is developed by another person. This solution re-implements the Posix classes in ACE and simulates asynchronous operations using threads and select statements. This solution is also good, but ACE does not include this solution. I personally think this is an ideal and perfect choice for ACE developers.
After trying to install TProactor, I tried Posix_AIO again, which is a solution for simulating AIO. Using this solution, the classes in ACE will not be replaced, you only need to add libPosix_AIO.a To The Makefile of ACE.
Finally, I solved this problem. I think there will be a lot of Proactor using ACE that will encounter this problem. Now, my system is implemented with ACE + TProactor and Posix-AIO.

From: http://blog.newsfan.net/leelin/archive/2007/01/14/7248.aspx

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.