diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-09-09 13:22:32 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-09-09 13:22:32 +0000 |
commit | a2216dff30eb29d6efc97302f0feabe32aeb7a5b (patch) | |
tree | ff48b16118f15fbe5d60ed54d65778d50eed28ea | |
parent | 58f7393ec27a10a03edc336b3be307f03ea9b36e (diff) | |
download | ATCD-a2216dff30eb29d6efc97302f0feabe32aeb7a5b.tar.gz |
ChangeLogTag:Sun Sep 9 08:28:52 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 73 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 73 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 73 | ||||
-rw-r--r-- | ace/Reactor_Impl.h | 3 | ||||
-rw-r--r-- | ace/Select_Reactor_Base.cpp | 56 | ||||
-rw-r--r-- | ace/Select_Reactor_Base.h | 3 | ||||
-rw-r--r-- | ace/TP_Reactor.cpp | 47 | ||||
-rw-r--r-- | ace/WFMO_Reactor.cpp | 12 | ||||
-rw-r--r-- | ace/WFMO_Reactor.h | 3 |
9 files changed, 243 insertions, 100 deletions
diff --git a/ChangeLog b/ChangeLog index 7c85eee03b9..92f4d84f33f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +Sun Sep 9 08:28:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> + + * ace/Reactor_Impl.h: + * ace/Select_Reactor_Base.h: + * ace/Select_Reactor_Base.cpp (is_dispatchable): Added a new + method. This method, just figures out whether the buffer has any + dispatchable info or not. + + * ace/WFMO_Reactor.h: + * ace/WFMO_Reactor.cpp: Added the above method in the WFMO + Reactor. + + * ace/TP_Reactor.cpp: The handle_notify_events () method now + checks whether the buffer it has read is dispatchable or not. If + it is then it gives up the token to make an upcall. Else, it + just sits around to remove messages of the pipe, till it find + one with a dispatchable info. The fix was necessary so that + wake-up calls that are unanswered are removed of the + pipe. Unanswered wakeup calls were filling up the pipe and they + were blocking some application from writing further to the + pipe. This should be in all probability be the final fix to the + Reactor. + Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Fixed a typo that was giving @@ -5,7 +28,7 @@ Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> Fri Sep 7 16:40:37 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added an if-def case for IP_MULTICAST_TTL too. Fri Sep 7 17:09:04 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -21,18 +44,18 @@ Fri Sep 7 15:51:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Included Auto_Ptr.h. Fri Sep 07 15:29:37 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - - * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: + + * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Fill_ACE_QoS.cpp: + * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Fill_ACE_QoS.cpp: Fixed compile errors. @@ -62,7 +85,7 @@ Thu Sep 6 21:14:05 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Changed the usage of auto_ptr <> to ACE_Auto_Basic_Ptr<>. Thanks to Carlos O'Ryan for this - suggestion. + suggestion. Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> @@ -71,16 +94,16 @@ Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> Thu Sep 6 12:01:15 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added a if-def case for IP_MULTICAST_IF. Seems like it is not defined in some of the OS versions. Thu Sep 06 12:36:43 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/OS.h: - * ace/OS.i: + * ace/OS.h: + * ace/OS.i: * ace/QoS/QoS_Session_Impl.cpp: - * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session.h: Fixed compile errors. @@ -137,7 +160,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> of number of active handles from wait_for_multiple_events (). The check for event_count > 0 before processing timer events was wrong. Removed the check. Thanks to Chad Elliott for - pointing this out. + pointing this out. Further did some cosmetic changes like adding comments, removing comments that was not valid etc. @@ -145,7 +168,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> Thu Sep 6 07:50:56 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/auto_run_tests.lst: The AMI buffering test should not be run - Single threaded builds. + Single threaded builds. Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> @@ -159,7 +182,7 @@ Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> Wed Sep 5 19:48:34 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/SOCK_Dgram.cpp (set_nic): + * ace/SOCK_Dgram.cpp (set_nic): Fixed the errors that raised in Win. Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -175,20 +198,20 @@ Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> Wed Sep 5 18:58:00 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/QoS/QoS_Session.h: - * ace/QoS/QoS_Session_Impl.h: + * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session_Impl.h: * ace/QoS/QoS_Session_Impl.cpp: Added rapi_sender and rapi_reserve calls with null tspec and flow spec respectively to facilitate the tearing down of PATH - and RESV messages. - - * ace/OS.h: + and RESV messages. + + * ace/OS.h: * ace/OS.i: Changed the sending_flowspec_ and receiving_flowspec_ members of the ACE_QoS class to pointers so they can be initialized to null - flow specs. + flow specs. Wed Sep 5 16:50:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 7c85eee03b9..92f4d84f33f 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,26 @@ +Sun Sep 9 08:28:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> + + * ace/Reactor_Impl.h: + * ace/Select_Reactor_Base.h: + * ace/Select_Reactor_Base.cpp (is_dispatchable): Added a new + method. This method, just figures out whether the buffer has any + dispatchable info or not. + + * ace/WFMO_Reactor.h: + * ace/WFMO_Reactor.cpp: Added the above method in the WFMO + Reactor. + + * ace/TP_Reactor.cpp: The handle_notify_events () method now + checks whether the buffer it has read is dispatchable or not. If + it is then it gives up the token to make an upcall. Else, it + just sits around to remove messages of the pipe, till it find + one with a dispatchable info. The fix was necessary so that + wake-up calls that are unanswered are removed of the + pipe. Unanswered wakeup calls were filling up the pipe and they + were blocking some application from writing further to the + pipe. This should be in all probability be the final fix to the + Reactor. + Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Fixed a typo that was giving @@ -5,7 +28,7 @@ Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> Fri Sep 7 16:40:37 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added an if-def case for IP_MULTICAST_TTL too. Fri Sep 7 17:09:04 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -21,18 +44,18 @@ Fri Sep 7 15:51:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Included Auto_Ptr.h. Fri Sep 07 15:29:37 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - - * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: + + * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Fill_ACE_QoS.cpp: + * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Fill_ACE_QoS.cpp: Fixed compile errors. @@ -62,7 +85,7 @@ Thu Sep 6 21:14:05 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Changed the usage of auto_ptr <> to ACE_Auto_Basic_Ptr<>. Thanks to Carlos O'Ryan for this - suggestion. + suggestion. Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> @@ -71,16 +94,16 @@ Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> Thu Sep 6 12:01:15 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added a if-def case for IP_MULTICAST_IF. Seems like it is not defined in some of the OS versions. Thu Sep 06 12:36:43 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/OS.h: - * ace/OS.i: + * ace/OS.h: + * ace/OS.i: * ace/QoS/QoS_Session_Impl.cpp: - * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session.h: Fixed compile errors. @@ -137,7 +160,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> of number of active handles from wait_for_multiple_events (). The check for event_count > 0 before processing timer events was wrong. Removed the check. Thanks to Chad Elliott for - pointing this out. + pointing this out. Further did some cosmetic changes like adding comments, removing comments that was not valid etc. @@ -145,7 +168,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> Thu Sep 6 07:50:56 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/auto_run_tests.lst: The AMI buffering test should not be run - Single threaded builds. + Single threaded builds. Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> @@ -159,7 +182,7 @@ Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> Wed Sep 5 19:48:34 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/SOCK_Dgram.cpp (set_nic): + * ace/SOCK_Dgram.cpp (set_nic): Fixed the errors that raised in Win. Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -175,20 +198,20 @@ Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> Wed Sep 5 18:58:00 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/QoS/QoS_Session.h: - * ace/QoS/QoS_Session_Impl.h: + * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session_Impl.h: * ace/QoS/QoS_Session_Impl.cpp: Added rapi_sender and rapi_reserve calls with null tspec and flow spec respectively to facilitate the tearing down of PATH - and RESV messages. - - * ace/OS.h: + and RESV messages. + + * ace/OS.h: * ace/OS.i: Changed the sending_flowspec_ and receiving_flowspec_ members of the ACE_QoS class to pointers so they can be initialized to null - flow specs. + flow specs. Wed Sep 5 16:50:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 7c85eee03b9..92f4d84f33f 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,26 @@ +Sun Sep 9 08:28:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> + + * ace/Reactor_Impl.h: + * ace/Select_Reactor_Base.h: + * ace/Select_Reactor_Base.cpp (is_dispatchable): Added a new + method. This method, just figures out whether the buffer has any + dispatchable info or not. + + * ace/WFMO_Reactor.h: + * ace/WFMO_Reactor.cpp: Added the above method in the WFMO + Reactor. + + * ace/TP_Reactor.cpp: The handle_notify_events () method now + checks whether the buffer it has read is dispatchable or not. If + it is then it gives up the token to make an upcall. Else, it + just sits around to remove messages of the pipe, till it find + one with a dispatchable info. The fix was necessary so that + wake-up calls that are unanswered are removed of the + pipe. Unanswered wakeup calls were filling up the pipe and they + were blocking some application from writing further to the + pipe. This should be in all probability be the final fix to the + Reactor. + Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Fixed a typo that was giving @@ -5,7 +28,7 @@ Sat Sep 8 09:34:52 2001 Balachandran Natarajan <bala@cs.wustl.edu> Fri Sep 7 16:40:37 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added an if-def case for IP_MULTICAST_TTL too. Fri Sep 7 17:09:04 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -21,18 +44,18 @@ Fri Sep 7 15:51:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Included Auto_Ptr.h. Fri Sep 07 15:29:37 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - - * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: - * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Receiver_FlowSpec/Fill_ACE_QoS.cpp: + + * examples/QOS/Change_Sender_TSpec/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Change_Sender_TSpec/Sender_QoS_Event_Handler.cpp:: + * examples/QOS/Change_Sender_TSpec/Fill_ACE_QoS.cpp: - * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: - * examples/QOS/Simple/Fill_ACE_QoS.cpp: + * examples/QOS/Simple/Receiver_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Sender_QoS_Event_Handler.cpp: + * examples/QOS/Simple/Fill_ACE_QoS.cpp: Fixed compile errors. @@ -62,7 +85,7 @@ Thu Sep 6 21:14:05 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Logging_Strategy_Test.cpp: Changed the usage of auto_ptr <> to ACE_Auto_Basic_Ptr<>. Thanks to Carlos O'Ryan for this - suggestion. + suggestion. Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> @@ -71,16 +94,16 @@ Thu Sep 06 18:42:39 2001 Steve Huston <shuston@riverace.com> Thu Sep 6 12:01:15 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/OS.h: + * ace/OS.h: Added a if-def case for IP_MULTICAST_IF. Seems like it is not defined in some of the OS versions. Thu Sep 06 12:36:43 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/OS.h: - * ace/OS.i: + * ace/OS.h: + * ace/OS.i: * ace/QoS/QoS_Session_Impl.cpp: - * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session.h: Fixed compile errors. @@ -137,7 +160,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> of number of active handles from wait_for_multiple_events (). The check for event_count > 0 before processing timer events was wrong. Removed the check. Thanks to Chad Elliott for - pointing this out. + pointing this out. Further did some cosmetic changes like adding comments, removing comments that was not valid etc. @@ -145,7 +168,7 @@ Thu Sep 6 11:00:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> Thu Sep 6 07:50:56 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/auto_run_tests.lst: The AMI buffering test should not be run - Single threaded builds. + Single threaded builds. Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> @@ -159,7 +182,7 @@ Thu Sep 6 02:30:14 2001 Christopher Kohlhoff <chris@kohlhoff.com> Wed Sep 5 19:48:34 2001 Priyanka Gontla <pgontla@ece.uci.edu> - * ace/SOCK_Dgram.cpp (set_nic): + * ace/SOCK_Dgram.cpp (set_nic): Fixed the errors that raised in Win. Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -175,20 +198,20 @@ Wed Sep 5 20:38:10 2001 Balachandran Natarajan <bala@cs.wustl.edu> Wed Sep 5 18:58:00 2001 Yamuna Krishnamurthy <yamuna@cs.wustl.edu> - * ace/QoS/QoS_Session.h: - * ace/QoS/QoS_Session_Impl.h: + * ace/QoS/QoS_Session.h: + * ace/QoS/QoS_Session_Impl.h: * ace/QoS/QoS_Session_Impl.cpp: Added rapi_sender and rapi_reserve calls with null tspec and flow spec respectively to facilitate the tearing down of PATH - and RESV messages. - - * ace/OS.h: + and RESV messages. + + * ace/OS.h: * ace/OS.i: Changed the sending_flowspec_ and receiving_flowspec_ members of the ACE_QoS class to pointers so they can be initialized to null - flow specs. + flow specs. Wed Sep 5 16:50:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> diff --git a/ace/Reactor_Impl.h b/ace/Reactor_Impl.h index b64da0fa527..71c0591f20c 100644 --- a/ace/Reactor_Impl.h +++ b/ace/Reactor_Impl.h @@ -74,6 +74,9 @@ public: /// the <Reactor_Impl> virtual ACE_HANDLE notify_handle (void) = 0; + /// Verify whether the buffer has dispatchable info or not. + virtual int is_dispatchable (ACE_Notification_Buffer &buffer)= 0; + /// Handle one of the notify call on the <handle>. This could be /// because of a thread trying to unblock the <Reactor_Impl> virtual int dispatch_notify (ACE_Notification_Buffer &buffer) = 0; diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index fd87211bde4..e5bb878b30f 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -783,6 +783,62 @@ ACE_Select_Reactor_Notify::notify_handle (void) // other than the main <ACE_Select_Reactor> thread. All we do is // write data to a pipe that the <ACE_Select_Reactor> is listening on. // Thanks to Paul Stephenson for suggesting this approach. +int +ACE_Select_Reactor_Notify::is_dispatchable (ACE_Notification_Buffer &buffer) +{ + // There is tonnes of code that can be abstracted... +#if defined (ACE_HAS_REACTOR_NOTIFICATION_QUEUE) + { + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->notify_queue_lock_, -1); + + ACE_Notification_Buffer *temp; + + ACE_UNUSED_ARG (buffer); + + // If the queue is empty just return 0 + if (notify_queue_.is_empty ()) + return 0; + + if (this->notify_queue_.dequeue_head (temp) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("dequeue_head")), + -1); + if (temp->eh_ != 0) + { + // If the queue had a buffer that has an event handler, put + // the element back in the queue and return a 1 + if (this->notify_queue_.enqueue_head (temp) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("enque_head")), + -1); + } + + return 1; + } + // Else put the element in the free queue + if (free_queue_.enqueue_head (temp) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("enqueue_head")), + -1); + } +#else + // If eh == 0 then another thread is unblocking the + // <ACE_Select_Reactor> to update the <ACE_Select_Reactor>'s + // internal structures. Otherwise, we need to dispatch the + // appropriate handle_* method on the <ACE_Event_Handler> + // pointer we've been passed. + if (buffer.eh_ != 0) + return 1; + +#endif /*ACE_HAS_REACTOR_NOTIFICATION_QUEUE */ + + // has no dispatchable buffer + return 0; +} int ACE_Select_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) diff --git a/ace/Select_Reactor_Base.h b/ace/Select_Reactor_Base.h index db34c2bd0aa..ca3a71c61e2 100644 --- a/ace/Select_Reactor_Base.h +++ b/ace/Select_Reactor_Base.h @@ -159,6 +159,9 @@ public: virtual int read_notify_pipe (ACE_HANDLE handle, ACE_Notification_Buffer &buffer); + /// Verify whether the buffer has dispatchable info or not. + virtual int is_dispatchable (ACE_Notification_Buffer &buffer); + /// Called back by the <ACE_Select_Reactor> when a thread wants to /// unblock us. virtual int handle_input (ACE_HANDLE handle); diff --git a/ace/TP_Reactor.cpp b/ace/TP_Reactor.cpp index a127fa3a57a..a857930d0a9 100644 --- a/ace/TP_Reactor.cpp +++ b/ace/TP_Reactor.cpp @@ -285,7 +285,7 @@ ACE_TP_Reactor::handle_timer_events (int & /*event_count*/, int -ACE_TP_Reactor::handle_notify_events (int &event_count, +ACE_TP_Reactor::handle_notify_events (int & /*event_count*/, ACE_TP_Token_Guard &guard) { // Get the handle on which notify calls could have occured @@ -294,21 +294,29 @@ ACE_TP_Reactor::handle_notify_events (int &event_count, int result = 0; - if (notify_handle != ACE_INVALID_HANDLE) - { - // Now just do a read on the pipe.. - ACE_Notification_Buffer buffer; + // The notify was not in the list returned by + // wait_for_multiple_events (). + if (notify_handle == ACE_INVALID_HANDLE) + return result; - if (this->notify_handler_->read_notify_pipe (notify_handle, - buffer) > 0) - { - // Decerement the number of event counts that still remains - // to be handled. - event_count--; + // Now just do a read on the pipe.. + ACE_Notification_Buffer buffer; - // Clear the handle of the read_mask of our <ready_set_> - // this->ready_set_.rd_mask_.clr_bit (notify_handle); + // Clear the handle of the read_mask of our <ready_set_> + this->ready_set_.rd_mask_.clr_bit (notify_handle); + // Keep reading notifies till we empty it or till we have a + // dispatchable buffer + while (this->notify_handler_->read_notify_pipe (notify_handle, + buffer) > 0) + { + // Just figure out whether we can read any buffer that has + // dispatchable info. If not we have just been unblocked by + // another thread trying to update the reactor. If we get any + // buffer that needs dispatching we will dispatch that after + // releasing the lock + if (this->notify_handler_->is_dispatchable (buffer) > 0) + { // Release the token before dispatching notifies... guard.release_token (); @@ -318,20 +326,17 @@ ACE_TP_Reactor::handle_notify_events (int &event_count, // We had a successful dispatch. result = 1; - // Put ourseleves in the queue - this->renew (); + // break out of the while loop + break; } - - // Read from the pipe failed.. - return result; } - // The notify was not in the list returned by - // wait_for_multiple_events (). + // If we did ssome work, then we just return 1 which will allow us + // to get out of here. If we return 0, then we will be asked to do + // some work ie. dispacth socket events return result; } - int ACE_TP_Reactor::handle_socket_events (int &event_count, ACE_TP_Token_Guard &guard) diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index cb68c7ea2a6..783454845e3 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -2179,14 +2179,18 @@ ACE_WFMO_Reactor::dump (void) const } int -ACE_WFMO_Reactor_Notify::dispatch_notifications (int &number_of_active_handles, - ACE_Handle_Set &rd_mask) +ACE_WFMO_Reactor_Notify::dispatch_notifications (int & /*number_of_active_handles*/, + ACE_Handle_Set & /*rd_mask*/) { - ACE_UNUSED_ARG (number_of_active_handles); - ACE_UNUSED_ARG (rd_mask); return -1; } +int +ACE_WFMO_Reactor_Notify::is_dispatchable (ACE_Notification_Buffer & /*buffer*/) +{ + return 0; +} + ACE_HANDLE ACE_WFMO_Reactor_Notify::notify_handle (void) { diff --git a/ace/WFMO_Reactor.h b/ace/WFMO_Reactor.h index 3cbb92740da..02ed32ed6df 100644 --- a/ace/WFMO_Reactor.h +++ b/ace/WFMO_Reactor.h @@ -514,6 +514,9 @@ public: /// because of a thread trying to unblock the <Reactor_Impl> virtual int dispatch_notify (ACE_Notification_Buffer &buffer); + /// Verify whether the buffer has dispatchable info or not. + virtual int is_dispatchable (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> |