NAME

ACE_Select_Reactor_Notify - Unblock the ACE_Select_Reactor from its event loop.

SYNOPSIS

#include <ace/Select_Reactor_Base.h>

class ACE_Select_Reactor_Notify : public ACE_Reactor_Notify { public: ACE_Select_Reactor_Notify (void); ~ACE_Select_Reactor_Notify (void); virtual int open ( ACE_Reactor_Impl *, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0 ); virtual int close (void); virtual ssize_t notify ( ACE_Event_Handler * = 0, ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, ACE_Time_Value * = 0 ); virtual int dispatch_notifications ( int &number_of_active_handles, ACE_Handle_Set &rd_mask ); virtual int handle_input (ACE_HANDLE handle); virtual void max_notify_iterations (int); virtual int max_notify_iterations (void); virtual void dump (void) const; ACE_ALLOC_HOOK_DECLARE; private: ACE_Select_Reactor_Impl *select_reactor_; ACE_Pipe notification_pipe_; int max_notify_iterations_; ACE_Unbounded_Queue <ACE_Notification_Buffer *> alloc_queue_; ACE_Unbounded_Queue <ACE_Notification_Buffer *> notify_queue_; ACE_Unbounded_Queue <ACE_Notification_Buffer *> free_queue_; ACE_SYNCH_MUTEX notify_queue_lock_; };

DESCRIPTION

This implementation is necessary for cases where the ACE_Select_Reactor is run in a multi-threaded program. In this case, we need to be able to unblock select or poll when updates occur other than in the main ACE_Select_Reactor thread. To do this, we signal an auto-reset event the ACE_Select_Reactor is listening on. If an ACE_Event_Handler and ACE_Select_Reactor_Mask is passed to notify, the appropriate handle_* method is dispatched in the context of the ACE_Select_Reactor thread.

Initialization and termination methods.

virtual int open (
    ACE_Reactor_Impl *,
    ACE_Timer_Queue * = 0,
    int disable_notify_pipe = 0
    );

virtual int close (void);

virtual ssize_t notify (
    ACE_Event_Handler * = 0,
    ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK,
    ACE_Time_Value * = 0
    );

virtual int dispatch_notifications (
    int &number_of_active_handles,
    ACE_Handle_Set &rd_mask
    );

virtual int handle_input (ACE_HANDLE handle);

virtual void max_notify_iterations (int);

virtual int max_notify_iterations (void);

virtual void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

AUTHOR

Doug Schmidt

LIBRARY

ace