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