ACE_TP_Reactor Class ReferenceSpecialization of ACE_Select_Reactor to support thread-pool based event dispatching. More...
Inheritance diagram for ACE_TP_Reactor:
Collaboration diagram for ACE_TP_Reactor:
Detailed DescriptionSpecialization of ACE_Select_Reactor to support thread-pool based event dispatching.One of the shortcomings of the ACE_Select_Reactor is that it does not support a thread pool-based event dispatching model, similar to the one in ACE_WFMO_Reactor. In ACE_Select_Reactor, only thread can call handle_events() at any given time. ACE_TP_Reactor removes this short-coming.
ACE_TP_Reactor is a specialization of ACE_Select_Reactor to support thread pool-based event dispatching. This reactor takes advantage of the fact that events reported by This reactor implementation is best suited for situations when the callbacks to event handlers can take arbitrarily long and/or a number of threads are available to run the event loop. Note that I/O-processing callback code in event handlers (e.g. handle_input()) does not have to be modified or made thread-safe for this reactor. This is because before an I/O event is dispatched to an event handler, the handler is suspended; it is resumed by the reactor after the upcall completes. Therefore, multiple I/O events will not be made to one event handler multiple threads simultaneously. This suspend/resume protection does not apply to either timers scheduled with the reactor or to notifications requested via the reactor. When using timers and/or notifications you must provide proper protection for your class in the context of multiple threads. Constructor & Destructor Documentation
Initialize ACE_TP_Reactor with the default size.
Initialize the ACE_TP_Reactor to manage max_number_of_handles. If restart is non-0 then the ACE_Reactor's
Deny access since member-wise won't work...
Member Function Documentation
This event loop driver that blocks for max_wait_time before returning. It will return earlier if timer events, I/O events, or signal events occur. Note that max_wait_time can be 0, in which case this method blocks indefinitely until events occur. max_wait_time is decremented to reflect how much time this call took. For instance, if a time value of 3 seconds is passed to handle_events and an event occurs after 2 seconds, max_wait_time will equal 1 second. This can be used if an application wishes to handle events for some fixed amount of time.
Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
This method is just like the one above, except the max_wait_time value is a reference and can therefore never be NULL. Current <alertable_handle_events> is identical to <handle_events>. Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
Does the reactor allow the application to resume the handle on its own ie. can it pass on the control of handle resumption to the application. The TP reactor has can allow applications to resume handles. So return a positive value. Reimplemented from ACE_Select_Reactor_Impl.
Called from handle events.
The ACE_TP_Reactor implementation does not have a single owner thread. Attempts to set the owner explicitly are ignored. The reported owner thread is the current Leader in the pattern. Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
Return the thread ID of the current Leader.
Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
Dispatch just 1 signal, timer, notification handlers.
Get the event that needs dispatching. It could be either a signal, timer, notification handlers or return possibly 1 I/O handler for dispatching. In the most common use case, this would return 1 I/O handler for dispatching
Handle timer events.
Handle notify events.
handle socket events
This method shouldn't get called.
Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
Get the handle of the notify pipe from the ready set if there is an event in the notify pipe.
Get socket event dispatch information.
Notify the appropriate <callback> in the context of the <eh> associated with <handle> that a particular event has occurred.
Clear the handle from the read_set.
Member Data DocumentationDeclare the dynamic allocation hooks.
Reimplemented from ACE_Select_Reactor_T< ACE_Select_Reactor_Token >.
The documentation for this class was generated from the following files: Generated on Mon Sep 15 07:18:00 2008 for ACE by 1.5.5 |