The realization method of reactor reactor _c language

Source: Internet
Author: User

Most applications use the default reactor instance provided by Ace_reactor::instance ().
But you can also choose your own reactor, because Ace uses bridge mode (two different classes: one is a programming interface, the other is implementation, and the first class passes each operation to the second class).
For example, using a thread pool reactor implementation:
ace_tp_reactor* tp_reactor = new Ace_tp_reactor;
ace_reactor* my_reactor = new Ace_reactor (tp_reactor, 1)//1 indicates that My_reactor
Tp_reactor is also deleted when the ace_reactor::instance is destroyed ( My_reactor, 1)//1 indicates that the My_reactor instance is deleted when the program terminates

the implementation of the reactor
1) ace_select_reactor
The default reactor implementation (Select () function) that is used by all platforms except Windows.
2) Ace_wfmo_reactor The default reactor implementation on
windows.
3) ace_msg_wfmo_reactor
to apply the com/dcom server.
4) ace_tp_reactor
extends Ace_select_reactor, allowing it to run simultaneously in multiple threads: the thread pool.
Leader/follower template, thread one will become the leader and get the ownership of the reactor to wait for the event. The
5) ace_priority_reactor
also extends Ace_select_reactor. The
uses the priority () method in the Ace_event_handler class to allow higher priority events to be processed first. The
6) GUI-integrated reactor
is used for the X Window System, which extends the ace_select_reactor.
single-threaded applications, but both respond to GUI time (such as button presses) and respond to your own application events.
QuickTime reactor
Fastlight reactor
Tk reactor
Xt reactor

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.