summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-06-21 01:55:06 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-06-21 01:55:06 +0000
commit6d60adf2d886974d61a913f110bfce7f09ff8cd6 (patch)
treee45ae872188edeaaccc39e253f2d403289271e53
parentb5a972bd3eafea8e44374135c092d2653b103c69 (diff)
downloadATCD-6d60adf2d886974d61a913f110bfce7f09ff8cd6.tar.gz
*** empty log message ***
-rw-r--r--ace/Acceptor.cpp9
-rw-r--r--ace/Acceptor.h3
-rw-r--r--ace/Asynch_IO.cpp72
-rw-r--r--ace/Asynch_IO.h10
-rw-r--r--ace/Proactor.cpp43
-rw-r--r--ace/Proactor.h37
-rw-r--r--ace/Reactor_Impl.h3
-rw-r--r--ace/Select_Reactor.cpp8
-rw-r--r--ace/Select_Reactor.h20
9 files changed, 133 insertions, 72 deletions
diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp
index 05276762fc8..9ab36352a90 100644
--- a/ace/Acceptor.cpp
+++ b/ace/Acceptor.cpp
@@ -54,10 +54,12 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
(const ACE_PEER_ACCEPTOR_ADDR &local_addr,
ACE_Reactor *reactor,
- int flags)
+ int flags,
+ int use_select)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open");
this->flags_ = flags;
+ this->use_select_ = use_select;
// Must supply a valid Reactor to Acceptor::open()...
@@ -94,12 +96,11 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor
(const ACE_PEER_ACCEPTOR_ADDR &addr,
ACE_Reactor *reactor,
int flags,
- use_select)
- : use_select_ (use_select)
+ int use_select)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor");
- if (this->open (addr, reactor, flags) == -1)
+ if (this->open (addr, reactor, flags, use_select) == -1)
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("%p\n"),
ASYS_TEXT ("ACE_Acceptor::ACE_Acceptor")));
diff --git a/ace/Acceptor.h b/ace/Acceptor.h
index f067206a25b..5a9f5fa775f 100644
--- a/ace/Acceptor.h
+++ b/ace/Acceptor.h
@@ -65,7 +65,8 @@ public:
int open (const ACE_PEER_ACCEPTOR_ADDR &,
ACE_Reactor * = ACE_Reactor::instance (),
- int flags = 0);
+ int flags = 0,
+ int use_select = 1);
// Initialize and register <this> with the Reactor and listen for
// connection requests at the designated <local_addr>. <flags>
// indicates how <SVC_HANDLER>'s should be initialized prior to
diff --git a/ace/Asynch_IO.cpp b/ace/Asynch_IO.cpp
index e6619e7b515..14d91e248e9 100644
--- a/ace/Asynch_IO.cpp
+++ b/ace/Asynch_IO.cpp
@@ -182,7 +182,7 @@ ACE_Asynch_Operation::register_aio_with_proactor (aiocb *aiocb_ptr)
if (this->proactor_->aiocb_list_cur_size_ >=
this->proactor_->aiocb_list_max_size_)
ACE_ERROR_RETURN ((LM_ERROR,
- "Asynch_Operation:No space to store the <aio> info.\n"),
+ "Asynch_Operation: No space to store the <aio> info.\n"),
-1);
// Slot(s) available. Find a free one.
@@ -196,7 +196,7 @@ ACE_Asynch_Operation::register_aio_with_proactor (aiocb *aiocb_ptr)
// Check again.
if (ai == this->proactor_->aiocb_list_max_size_)
ACE_ERROR_RETURN ((LM_ERROR,
- "Asynch_Operation:No space to store the <aio> info.\n"),
+ "Asynch_Operation: No space to store the <aio> info.\n"),
-1);
// Store the pointers.
@@ -254,7 +254,7 @@ ACE_Asynch_Read_Stream::shared_read (ACE_Asynch_Read_Stream::Result *result)
{
// No space.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Read_Stream:No space to queue aio_read\n"));
+ "(%p %t) Asynch_Read_Stream: No space to queue aio_read\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -284,7 +284,7 @@ ACE_Asynch_Read_Stream::shared_read (ACE_Asynch_Read_Stream::Result *result)
{
// Queueing failed.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Read_Stream:aio_read queueing failed\n"));
+ "(%p %t) Asynch_Read_Stream: aio_read queueing failed\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -297,7 +297,7 @@ ACE_Asynch_Read_Stream::shared_read (ACE_Asynch_Read_Stream::Result *result)
{
// Couldnt store the aiocb.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Read_Stream:Fatal error\n"));
+ "(%p %t) Asynch_Read_Stream:Fatal error\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -440,7 +440,7 @@ ACE_Asynch_Write_Stream::shared_write (ACE_Asynch_Write_Stream::Result *result)
{
// No space.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Write_Stream:No space to queue aio_read\n"));
+ "(%p %t) Asynch_Write_Stream: No space to queue aio_read\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -470,7 +470,7 @@ ACE_Asynch_Write_Stream::shared_write (ACE_Asynch_Write_Stream::Result *result)
{
// Queueing failed.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Write_Stream:aio_write queueing failed\n"));
+ "(%p %t) Asynch_Write_Stream: aio_write queueing failed\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -483,7 +483,7 @@ ACE_Asynch_Write_Stream::shared_write (ACE_Asynch_Write_Stream::Result *result)
{
// Couldnt store the aiocb.
ACE_ERROR ((LM_ERROR,
- "(%p %t):Asynch_Write_Stream:Fatal error\n"));
+ "(%p %t) Asynch_Write_Stream: Fatal error\n"));
// Clean up the memory allocated.
delete aiocb_ptr;
@@ -737,7 +737,9 @@ ACE_Asynch_Accept::accept (ACE_Message_Block &message_block,
SOCK_STREAM,
0);
if (accept_handle == ACE_INVALID_HANDLE)
- ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_OS::socket")), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS::socket")), -1);
else
// Remember to close the socket down if failures occur.
close_accept_handle = 1;
@@ -898,6 +900,7 @@ ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file,
// Configure the result parameter.
Result *result = 0;
+
ACE_NEW_RETURN (result,
Result (*this->handler_,
this->handle_,
@@ -914,19 +917,19 @@ ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file,
// Make the auxillary handler and initiate transmit.
ACE_Asynch_Transmit_Handler *transmit_handler = 0;
+
ACE_NEW_RETURN (transmit_handler,
::ACE_Asynch_Transmit_Handler (result),
-1);
ssize_t return_val = transmit_handler->transmit ();
+
if (return_val == -1)
// This deletes the result in it.
delete transmit_handler;
return return_val;
-
-#else /* ACE_HAS_AIO_CALLS */
-#if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))
+#elif (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))
Result *result = 0;
ACE_NEW_RETURN (result,
Result (*this->handler_,
@@ -978,7 +981,6 @@ ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file,
}
#else /* (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) */
ACE_NOTSUP_RETURN (-1);
-#endif /* (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) */
#endif /* ACE_HAS_AIO_CALLS */
}
@@ -1202,6 +1204,11 @@ ACE_Asynch_Transmit_Handler::ACE_Asynch_Transmit_Handler (ACE_Asynch_Transmit_Fi
ACE_Message_Block (this->result_->bytes_per_send ()
+ 1));
+ // @@ Alex, must we (1) use dynamic memory for this and (2) allocate
+ // 3 separate chunks of memory? This seems costly. Is there any
+ // way to optimize it, e.g., by combining multiple
+ // operations/buffers into fewer ones?
+
// Memory for the ACTs.
ACE_NEW (this->header_act_,
ACT);
@@ -1236,16 +1243,19 @@ ACE_Asynch_Transmit_Handler::~ACE_Asynch_Transmit_Handler (void)
int
ACE_Asynch_Transmit_Handler::transmit (void)
{
- ACE_DEBUG ((LM_DEBUG, "Asynch_Transmit_Handler::transmit\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Asynch_Transmit_Handler::transmit\n"));
// Open Asynch_Read_File.
- if (this->rf_.open (*this, this->result_->file ()) == -1)
+ if (this->rf_.open (*this,
+ this->result_->file ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%p %t):ACE_Asynch_Transmit_Handler:read_file open failed\n"),
-1);
// Open Asynch_Write_Stream.
- if (this->ws_.open (*this, this->result_->socket ()) == -1)
+ if (this->ws_.open (*this,
+ this->result_->socket ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"ACE_Asynch_Transmit_Handler:write_stream open failed\n"),
-1);
@@ -1253,11 +1263,10 @@ ACE_Asynch_Transmit_Handler::transmit (void)
// Transmit the header.
if (this->ws_.write (*this->result_->header_and_trailer ()->header (),
this->result_->header_and_trailer ()->header_bytes (),
- (void *)this->header_act_) == -1)
+ (void *) this->header_act_) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%p %t):Asynch_Transmit_Handler:transmitting header:write_stream failed\n"),
-1);
-
return 0;
}
@@ -1272,7 +1281,8 @@ ACE_Asynch_Transmit_Handler::handle_write_stream (const ACE_Asynch_Write_Stream:
// Check the success parameter.
if (result.success () == 0)
{
- ACE_ERROR ((LM_ERROR, "Asynch_Transmit_File failed.\n"));
+ ACE_ERROR ((LM_ERROR,
+ "Asynch_Transmit_File failed.\n"));
ACE_SEH_TRY
{
@@ -1307,23 +1317,25 @@ ACE_Asynch_Transmit_Handler::handle_write_stream (const ACE_Asynch_Write_Stream:
return;
}
- // @@ Handling *partial write* to a socket.
- // Let us not continue further before this write
- // finishes. Because proceeding with another read and then write
- // might change the order of the file transmission, because
- // partial write to the stream is always possible.
+ // @@ Handling *partial write* to a socket. Let us not continue
+ // further before this write finishes. Because proceeding with
+ // another read and then write might change the order of the
+ // file transmission, because partial write to the stream is
+ // always possible.
return;
}
// Not a partial write.
// Check ACT to see what was sent.
- ACT act = *(ACT *)result.act ();
+ ACT act = *(ACT *) result.act ();
+
switch (act)
{
- // If it is the "trailer" that is just sent, then transmit
- // file is complete.
case TRAILER_ACT:
+ // If it is the "trailer" that is just sent, then transmit file
+ // is complete.
+
ACE_SEH_TRY
{
this->result_->complete (this->bytes_transferred_,
@@ -1337,11 +1349,11 @@ ACE_Asynch_Transmit_Handler::handle_write_stream (const ACE_Asynch_Write_Stream:
}
break;
- // If header/data was sent, initiate the file data
- // transmission.
case HEADER_ACT:
case DATA_ACT:
- if (initiate_read_file () == -1)
+ // If header/data was sent, initiate the file data transmission.
+
+ if (this->initiate_read_file () == -1)
ACE_ERROR ((LM_ERROR,
"(%p %t):Asynch_Transmit_Handler:read_file couldnt be initiated\n"));
break;
diff --git a/ace/Asynch_IO.h b/ace/Asynch_IO.h
index 9053ffaac5c..01766b30bff 100644
--- a/ace/Asynch_IO.h
+++ b/ace/Asynch_IO.h
@@ -597,7 +597,7 @@ public:
// Forward declaration.
ACE_Asynch_Transmit_File (void);
- // A do nothing constructor.
+ // A "do-nothing" constructor.
int transmit_file (ACE_HANDLE file,
Header_And_Trailer *header_and_trailer = 0,
@@ -880,6 +880,7 @@ public:
int transmit (void);
// Do the transmission. All the info to do the transmission is in
// the <result> member.
+
protected:
virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result);
// This is called when asynchronous writes from the socket complete.
@@ -909,9 +910,10 @@ private:
DATA_ACT = 2,
TRAILER_ACT = 3
};
- ACT * header_act_;
- ACT * data_act_;
- ACT * trailer_act_;
+
+ ACT *header_act_;
+ ACT *data_act_;
+ ACT *trailer_act_;
// ACT to transmit header, data and trailer.
size_t file_offset_;
diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp
index 51f7a2b61e3..60d6528cf21 100644
--- a/ace/Proactor.cpp
+++ b/ace/Proactor.cpp
@@ -150,19 +150,24 @@ ACE_Proactor_Handle_Timeout_Upcall::timeout (TIMER_QUEUE &timer_queue,
if (this->proactor_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
- "(%t) No Proactor set in ACE_Proactor_Handle_Timeout_Upcall, no completion port to post timeout to?!@\n"),
+ ASYS_TEXT ("(%t) No Proactor set in ACE_Proactor_Handle_Timeout_Upcall,")
+ ASYS_TEXT (" no completion port to post timeout to?!@\n")),
-1);
// Create the Asynch_Timer.
- ACE_Proactor::Asynch_Timer *asynch_timer
- = new ACE_Proactor::Asynch_Timer (*handler,
- act,
- time);
+ ACE_Proactor::Asynch_Timer *asynch_timer;
+ ACE_NEW_RETURN (asynch_timer,
+ ACE_Proactor::Asynch_Timer (*handler,
+ act,
+ time),
+ -1);
+
// Post a completion.
if (this->proactor_->post_completion (asynch_timer) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- "Failure in dealing with timers: PostQueuedCompletionStatus failed\n"), -1);
-
+ ASYS_TEXT ("Failure in dealing with timers: ")
+ ASYS_TEXT ("PostQueuedCompletionStatus failed\n"),
+ -1);
return 0;
}
@@ -200,7 +205,8 @@ ACE_Proactor_Handle_Timeout_Upcall::proactor (ACE_Proactor &proactor)
}
else
ACE_ERROR_RETURN ((LM_ERROR,
- "ACE_Proactor_Handle_Timeout_Upcall is only suppose to be used with ONE (and only one) Proactor\n"),
+ ASYS_TEXT ("ACE_Proactor_Handle_Timeout_Upcall is only suppose")
+ ASYS_TEXT (" to be used with ONE (and only one) Proactor\n")),
-1);
}
@@ -212,6 +218,7 @@ ACE_Proactor::ACE_Proactor (size_t number_of_threads,
#if defined (_POSIX_RTSIG_MAX)
aiocb_list_max_size_ (_POSIX_RTSIG_MAX),
#else /* _POSIX_RTSIG_MAX */
+ // @@ Alex, please fix this to NOT use magic numbers...
aiocb_list_max_size_ (8),
#endif /* AIO_LISTIO_MAX */
aiocb_list_cur_size_ (0),
@@ -226,11 +233,13 @@ ACE_Proactor::ACE_Proactor (size_t number_of_threads,
used_with_reactor_event_loop_ (used_with_reactor_event_loop)
{
#if defined (ACE_HAS_AIO_CALLS)
- // Init the array.
+ // Initialize the array.
+
for (size_t ai = 0;
ai < this->aiocb_list_max_size_;
ai++)
aiocb_list_[ai] = 0;
+
ACE_UNUSED_ARG (tq);
ACE_DEBUG ((LM_DEBUG,
@@ -614,7 +623,6 @@ ACE_Proactor::handle_events (unsigned long milli_seconds)
ACE_ERROR_RETURN ((LM_ERROR,
"(%p):aio_suspend"),
-1);
-
// Check which aio has finished.
size_t ai;
ssize_t nbytes = 0;
@@ -625,7 +633,9 @@ ACE_Proactor::handle_events (unsigned long milli_seconds)
// Analyze error and return values.
if (aio_error (aiocb_list_[ai]) != EINPROGRESS)
{
- if ((nbytes = aio_return (aiocb_list_[ai])) == -1)
+ nbytes = aio_return (aiocb_list_[ai]);
+
+ if (nbytes == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"(%p):AIO failed"),
-1);
@@ -648,12 +658,12 @@ ACE_Proactor::handle_events (unsigned long milli_seconds)
// Bytes transfered is what the aio_return gives back.
size_t bytes_transferred = nbytes;
- //@@
+ // @@
void *completion_key = 0;
// Retrive the result pointer.
- ACE_Asynch_Result *asynch_result =
- (ACE_Asynch_Result *) aiocb_list_[ai]->aio_sigevent.sigev_value.sival_ptr;
+ ACE_Asynch_Result *asynch_result = (ACE_Asynch_Result *)
+ aiocb_list_[ai]->aio_sigevent.sigev_value.sival_ptr;
// Invalidate entry in the aiocb list.
delete this->aiocb_list_[ai];
@@ -689,7 +699,10 @@ ACE_Proactor::handle_events (unsigned long milli_seconds)
return 0;
}
else
- ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("GetQueuedCompletionStatus")), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("GetQueuedCompletionStatus")),
+ -1);
}
else
{
diff --git a/ace/Proactor.h b/ace/Proactor.h
index 3feca988f7c..7724966110a 100644
--- a/ace/Proactor.h
+++ b/ace/Proactor.h
@@ -44,7 +44,7 @@ class ACE_Proactor;
class ACE_Export ACE_Proactor_Handle_Timeout_Upcall
{
// = TITLE
- // Functor for Timer_Queues.
+ // Functor for <ACE_Timer_Queue>.
//
// = DESCRIPTION
// This class implements the functor required by the Timer
@@ -59,7 +59,7 @@ public:
TIMER_QUEUE;
ACE_Proactor_Handle_Timeout_Upcall (void);
- // Constructor
+ // Constructor.
int timeout (TIMER_QUEUE &timer_queue,
ACE_Handler *handler,
@@ -88,14 +88,16 @@ protected:
class ACE_Export ACE_Proactor : public ACE_Event_Handler
{
// = TITLE
- // A Proactor for asynchronous I/O events.
+ // A manager for asynchronous event demultiplexing.
//
// = DESCRIPTION
- // A manager for the I/O completion port.
+ // See the Proactor pattern description at
+ // http://www.cs.wustl.edu/~schmidt/proactor.ps.gz for more
+ // details.
public:
friend class ACE_Proactor_Timer_Handler;
- // Timer Handler has special privileges because
- // Access needed to: thr_mgr_
+ // Timer Handler has special privileges because Access needed to:
+ // thr_mgr_
friend class ACE_Proactor_Handle_Timeout_Upcall;
// Access needed to: Asynch_Timer, and completion_port_.
@@ -265,6 +267,8 @@ public:
protected:
#if defined (ACE_HAS_AIO_CALLS)
+ // @@ Alex, you can probably just give "friendship" for the whole
+ // class, not just the one method.
friend int ACE_Asynch_Operation::register_aio_with_proactor (aiocb *aiocb_ptr);
// This call is for POSIX <aio_> calls. This method is used by
// <ACE_Asynch_Operation> to store some information with the
@@ -292,6 +296,9 @@ protected:
// Dispatch a single set of events. If <milli_seconds> elapses
// before any events occur, return.
+ // @@ Alex, many C++ compilers don't like nested classes. Can you
+ // please bring this into the "outer scope" and add an "ACE_" prefix
+ // to it?
class ACE_Export Asynch_Timer : protected ACE_Asynch_Result
{
// = TITLE
@@ -321,13 +328,16 @@ protected:
};
#if defined (ACE_HAS_AIO_CALLS)
- // Let us have an array to keep track of the all the aio's issued
- // currently. My intuition is to limit the array size to Maximum RT
- // signals that can be queued in a process. That should be the upper
- // limit how many aio can be pending at a time.
+ // Use an array to keep track of the all the aio's issued
+ // currently. We'll limit the array size to Maximum RT signals that
+ // can be queued in a process. This is the upper limit how many aio
+ // operations can be pending at a time.
#if defined (_POSIX_RTSIG_MAX)
aiocb *aiocb_list_ [_POSIX_RTSIG_MAX];
#else /* _POSIX_RTSIG_MAX */
+ // @@ Alex, please don't use "magic numbers" like 8. Make sure to
+ // put this kind of value in the OS.h file somewhere and make it a
+ // symbolic constant.
// Minimum is 8.
struct aiocb *aiocb_list_ [8];
#endif /* AIO_LIST_AIO_MAX */
@@ -344,8 +354,11 @@ protected:
#endif /* ACE_HAS_AIO_CALLS */
size_t number_of_threads_;
- // This number is passed to the <CreatIOCompletionPort> system
- // call.
+ // This number is passed to the <CreatIOCompletionPort> system call.
+ // @@ Alex, is this WinNT specific? If so, can you please move it
+ // into the ACE_WIN32 section? Better yet is to use the Bridge
+ // pattern and make separate subclasses for the implementation to
+ // remove the need for #ifdefs.
Timer_Queue *timer_queue_;
// Timer Queue.
diff --git a/ace/Reactor_Impl.h b/ace/Reactor_Impl.h
index 863ca0f2736..5e42de8e28b 100644
--- a/ace/Reactor_Impl.h
+++ b/ace/Reactor_Impl.h
@@ -76,6 +76,9 @@ public:
// will iterate and dispatch the <ACE_Event_Handlers> that are
// passed in via the notify queue before breaking out of its event
// loop.
+
+ virtual void dump (void) const = 0;
+ // Dump the state of an object.
};
class ACE_Export ACE_Reactor_Impl
diff --git a/ace/Select_Reactor.cpp b/ace/Select_Reactor.cpp
index 9d2f5095c53..f89d9af65fc 100644
--- a/ace/Select_Reactor.cpp
+++ b/ace/Select_Reactor.cpp
@@ -639,7 +639,7 @@ ACE_Select_Reactor_Notify::max_notify_iterations (int iterations)
}
int
-ACE_Select_Reactor_Notify::max_notify_iterations (int iterations)
+ACE_Select_Reactor_Notify::max_notify_iterations (void)
{
return this->max_notify_iterations_;
}
@@ -1081,7 +1081,7 @@ ACE_Select_Reactor::set_timer_queue (ACE_Timer_Queue *timer_queue)
ACE_Select_Reactor::ACE_Select_Reactor (ACE_Sig_Handler *sh,
ACE_Timer_Queue *tq,
int disable_notify_pipe,
- ACE_Select_Reactor_Notify *notify)
+ ACE_Reactor_Notify *notify)
: handler_rep_ (*this),
timer_queue_ (0),
delete_timer_queue_ (0),
@@ -1116,7 +1116,7 @@ ACE_Select_Reactor::ACE_Select_Reactor (size_t size,
ACE_Sig_Handler *sh,
ACE_Timer_Queue *tq,
int disable_notify_pipe,
- ACE_Select_Reactor_Notify *notify)
+ ACE_Reactor_Notify *notify)
: handler_rep_ (*this),
timer_queue_ (0),
delete_timer_queue_ (0),
@@ -1128,7 +1128,7 @@ ACE_Select_Reactor::ACE_Select_Reactor (size_t size,
#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
token_ (*this),
#endif /* ACE_MT_SAFE */
- lock_adapter_ (token_),
+ lock_adapter_ (token_)
{
ACE_TRACE ("ACE_Select_Reactor::ACE_Select_Reactor");
diff --git a/ace/Select_Reactor.h b/ace/Select_Reactor.h
index 66ca3a73f5f..c5e5eeddb88 100644
--- a/ace/Select_Reactor.h
+++ b/ace/Select_Reactor.h
@@ -118,7 +118,7 @@ public:
void select_reactor (ACE_Select_Reactor &);
// Set/Get methods
- void dump (void) const;
+ virtual void dump (void) const;
// Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
@@ -224,7 +224,7 @@ public:
// dispatch the <ACE_Event_Handlers> that are passed in via the
// notify pipe before breaking out of its <recv> loop.
- void dump (void) const;
+ virtual void dump (void) const;
// Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
@@ -670,6 +670,22 @@ public:
// action is possible, else will wait until the relative time
// specified in *<timeout> elapses).
+ virtual void max_notify_iterations (int);
+ // Set the maximum number of times that the
+ // <ACE_Select_Reactor_Notify::handle_input> method will iterate and
+ // dispatch the <ACE_Event_Handlers> 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.
+
+ virtual int max_notify_iterations (void);
+ // Get the maximum number of times that the
+ // <ACE_Select_Reactor_Notify::handle_input> method will iterate and
+ // dispatch the <ACE_Event_Handlers> that are passed in via the
+ // notify pipe before breaking out of its <recv> loop.
+
virtual void requeue_position (int);
// Set position that the main ACE_Select_Reactor thread is requeued in the
// list of waiters during a notify() callback.