Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Select_Reactor_Notify Class Reference

Unblock the from its event loop. More...

`#include <Select_Reactor_Base.h>`

Inheritance diagram for ACE_Select_Reactor_Notify

[legend]
Collaboration diagram for ACE_Select_Reactor_Notify:

[legend]
List of all members.

## Public Methods
| ACE_Select_Reactor_Notify (void)
| Default dtor.
| ~ACE_Select_Reactor_Notify (void)
virtual int | open (ACE_Reactor_Impl *, ACE_Timer_Queue * = 0, int disable_notify_pipe = 0)
| Initialize.
virtual int | close (void)
| Destroy.
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)
| Handles pending threads (if any) that are waiting to unblock the .
virtual ACE_HANDLE | notify_handle (void)
| Returns the ACE_HANDLE of the notify pipe on which the reactor is listening for notifications so that other threads can unblock the Select_Reactor.
virtual int | dispatch_notify (ACE_Notification_Buffer &buffer)
| Handle one of the notify call on the <handle>. This could be because of a thread trying to unblock the <Reactor_Impl>.
virtual int | read_notify_pipe (ACE_HANDLE handle, ACE_Notification_Buffer &buffer)
| Read one of the notify call on the <handle> into the <buffer>. This could be because of a thread trying to unblock the <Reactor_Impl>.
virtual int | is_dispatchable (ACE_Notification_Buffer &buffer)
| Verify whether the buffer has dispatchable info or not.
virtual int | handle_input (ACE_HANDLE handle)
| Called back by the when a thread wants to unblock us.
virtual void | max_notify_iterations (int)
virtual int | max_notify_iterations (void)
virtual int | purge_pending_notifications (ACE_Event_Handler *, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK)
virtual void | dump (void) const
| Dump the state of an object.
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks.
## Protected Attributes
ACE_Select_Reactor_Impl* | select_reactor_
ACE_Pipe | notification_pipe_
int | max_notify_iterations_

## Detailed Description

Unblock the from its event loop.

This implementation is necessary for cases where the 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 thread. To do this, we signal an auto-reset event the is listening on. If an and is passed to <notify>, the appropriate <handle_*> method is dispatched in the context of the thread.

## Constructor & Destructor Documentation

ACE_Select_Reactor_Notify::ACE_Select_Reactor_Notify ( | void )

| Default dtor.

ACE_INLINE ACE_Select_Reactor_Notify::~ACE_Select_Reactor_Notify ( | void )

## Member Function Documentation

int ACE_Select_Reactor_Notify::close ( | void )`[virtual]`

| Destroy. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::dispatch_notifications ( | int & number_of_active_handles,
| ACE_Handle_Set & rd_mask )`[virtual]`

| Handles pending threads (if any) that are waiting to unblock the . Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::dispatch_notify ( | ACE_Notification_Buffer & buffer )`[virtual]`

| Handle one of the notify call on the <handle>. This could be because of a thread trying to unblock the <Reactor_Impl>. Reimplemented from ACE_Reactor_Notify.

void ACE_Select_Reactor_Notify::dump ( | void ) const`[virtual]`

| Dump the state of an object. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::handle_input ( | ACE_HANDLE handle )`[virtual]`

| Called back by the when a thread wants to unblock us. Reimplemented from ACE_Event_Handler.

int ACE_Select_Reactor_Notify::is_dispatchable ( | ACE_Notification_Buffer & buffer )`[virtual]`

| Verify whether the buffer has dispatchable info or not. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::max_notify_iterations ( | void )`[virtual]`

| Get the maximum number of times that the method will iterate and dispatch the that are passed in via the notify pipe before breaking out of its <recv> loop. Reimplemented from ACE_Reactor_Notify.

void ACE_Select_Reactor_Notify::max_notify_iterations ( | int iterations )`[virtual]`

| Set the maximum number of times that the method will iterate and dispatch the that are passed in via the notify pipe before breaking out of its <recv> loop. By default, this is set to -1, which means "iterate until the pipe is empty." Setting this to a value like "1 or 2" will increase "fairness" (and thus prevent starvation) at the expense of slightly higher dispatching overhead. Reimplemented from ACE_Reactor_Notify.

ssize_t ACE_Select_Reactor_Notify::notify ( | ACE_Event_Handler * eh = 0,
| ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK,
| ACE_Time_Value * timeout = 0 )`[virtual]`

| Called by a thread when it wants to unblock the . This wakeups the if currently blocked in <select>/<poll>. Pass over both the <Event_Handler> *and* the <mask> to allow the caller to dictate which <Event_Handler> method the will invoke. The indicates how long to blocking trying to notify the . If <timeout> == 0, the caller will block until action is possible, else will wait until the relative time specified in *<timeout> elapses). Reimplemented from ACE_Reactor_Notify.

ACE_HANDLE ACE_Select_Reactor_Notify::notify_handle ( | void )`[virtual]`

| Returns the ACE_HANDLE of the notify pipe on which the reactor is listening for notifications so that other threads can unblock the Select_Reactor. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::open ( | ACE_Reactor_Impl * r,
| ACE_Timer_Queue * timer_queue = 0,
| int disable_notify_pipe = 0 )`[virtual]`

| Initialize. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::purge_pending_notifications ( | ACE_Event_Handler * eh,
| ACE_Reactor_Mask mask = ACE_Event_Handler::ALL_EVENTS_MASK )`[virtual]`

| Purge any notifications pending in this reactor for the specified object. If <eh> == 0, all notifications for all handlers are removed (but not any notifications posted just to wake up the reactor itself). Returns the number of notifications purged. Returns -1 on error. Reimplemented from ACE_Reactor_Notify.

int ACE_Select_Reactor_Notify::read_notify_pipe ( | ACE_HANDLE handle,
| ACE_Notification_Buffer & buffer )`[virtual]`

| Read one of the notify call on the <handle> into the <buffer>. This could be because of a thread trying to unblock the <Reactor_Impl>. Reimplemented from ACE_Reactor_Notify.

## Member Data Documentation

ACE_Select_Reactor_Notify::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

int ACE_Select_Reactor_Notify::max_notify_iterations_`[protected]`

| Keeps track of the maximum number of times that the method will iterate and dispatch the that are passed in via the notify pipe before breaking out of its <recv> loop. By default, this is set to -1, which means "iterate until the pipe is empty."

ACE_Pipe ACE_Select_Reactor_Notify::notification_pipe_`[protected]`

| Contains the the is listening on, as well as the that threads wanting the attention of the will write to.

ACE_Select_Reactor_Impl * ACE_Select_Reactor_Notify::select_reactor_`[protected]`

| Keep a back pointer to the . If this value if NULL then the has been initialized with <disable_notify_pipe>.

The documentation for this class was generated from the following files:

- Select_Reactor_Base.h
- Select_Reactor_Base.cpp
- Select_Reactor_Base.i