summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--ChangeLogs/ChangeLog-02a25
-rw-r--r--ChangeLogs/ChangeLog-03a25
-rw-r--r--ace/WFMO_Reactor.cpp31
4 files changed, 91 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c2fe396128..4bb21415806 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+Thu May 09 00:38:22 2002 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Added a fix for bug
+ 1161. The problem was described aptly and the fix was applied
+ exactly as suggested by Lyn Headley <headley@wolve.com>:
+
+ Problem: "The do-while loop in this function is problematic,
+ because active threads is incremented once prior to executing
+ the loop, and then decremented on every iteration of the loop
+ inside safe dispatch(). Thus on the second iteration of the
+ loop active threads is decremented to 2^32, which causes the
+ thread to block on waiting to change state inside update
+ state(), which is never signaled (because there are no other
+ active threads)."
+
+ Solution: "Moving the do clause of the loop up a few statements
+ to include the increment of active threads (and the acquisition
+ of the lock) would probably fix the larger bug."
+
+ Also, thanks to Lyn Headley <headley@wolve.com> and P Mason
+ <pmason@wolve.com> at Wolverine, and Kobi Cohen Arazi
+ <kobi@mivzak.com>, Mike Winter (mwinter@sonic.net),
+ <sturtesm@hotmail.com> who have all suggested fimilar problems
+ and fixes.
+
Thu May 09 00:06:47 2002 Irfan Pyarali <irfan@cs.wustl.edu>
* examples/Reactor/WFMO_Reactor: Added the "Static Debug", "Static
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 5c2fe396128..4bb21415806 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,28 @@
+Thu May 09 00:38:22 2002 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Added a fix for bug
+ 1161. The problem was described aptly and the fix was applied
+ exactly as suggested by Lyn Headley <headley@wolve.com>:
+
+ Problem: "The do-while loop in this function is problematic,
+ because active threads is incremented once prior to executing
+ the loop, and then decremented on every iteration of the loop
+ inside safe dispatch(). Thus on the second iteration of the
+ loop active threads is decremented to 2^32, which causes the
+ thread to block on waiting to change state inside update
+ state(), which is never signaled (because there are no other
+ active threads)."
+
+ Solution: "Moving the do clause of the loop up a few statements
+ to include the increment of active threads (and the acquisition
+ of the lock) would probably fix the larger bug."
+
+ Also, thanks to Lyn Headley <headley@wolve.com> and P Mason
+ <pmason@wolve.com> at Wolverine, and Kobi Cohen Arazi
+ <kobi@mivzak.com>, Mike Winter (mwinter@sonic.net),
+ <sturtesm@hotmail.com> who have all suggested fimilar problems
+ and fixes.
+
Thu May 09 00:06:47 2002 Irfan Pyarali <irfan@cs.wustl.edu>
* examples/Reactor/WFMO_Reactor: Added the "Static Debug", "Static
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 5c2fe396128..4bb21415806 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,28 @@
+Thu May 09 00:38:22 2002 Irfan Pyarali <irfan@cs.wustl.edu>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Added a fix for bug
+ 1161. The problem was described aptly and the fix was applied
+ exactly as suggested by Lyn Headley <headley@wolve.com>:
+
+ Problem: "The do-while loop in this function is problematic,
+ because active threads is incremented once prior to executing
+ the loop, and then decremented on every iteration of the loop
+ inside safe dispatch(). Thus on the second iteration of the
+ loop active threads is decremented to 2^32, which causes the
+ thread to block on waiting to change state inside update
+ state(), which is never signaled (because there are no other
+ active threads)."
+
+ Solution: "Moving the do clause of the loop up a few statements
+ to include the increment of active threads (and the acquisition
+ of the lock) would probably fix the larger bug."
+
+ Also, thanks to Lyn Headley <headley@wolve.com> and P Mason
+ <pmason@wolve.com> at Wolverine, and Kobi Cohen Arazi
+ <kobi@mivzak.com>, Mike Winter (mwinter@sonic.net),
+ <sturtesm@hotmail.com> who have all suggested fimilar problems
+ and fixes.
+
Thu May 09 00:06:47 2002 Irfan Pyarali <irfan@cs.wustl.edu>
* examples/Reactor/WFMO_Reactor: Added the "Static Debug", "Static
diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp
index cb674dd425c..0e8c79ebe8d 100644
--- a/ace/WFMO_Reactor.cpp
+++ b/ace/WFMO_Reactor.cpp
@@ -1603,25 +1603,26 @@ ACE_WFMO_Reactor::event_handling (ACE_Time_Value *max_wait_time,
// called.
ACE_Countdown_Time countdown (max_wait_time);
- // Check to see if it is ok to enter ::WaitForMultipleObjects
- // This will acquire <this->lock_> on success
- // On failure, the lock will not be acquired
- int result = this->ok_to_wait (max_wait_time, alertable);
- if (result != 1)
- return result;
+ int result;
+ do
+ {
+ // Check to see if it is ok to enter ::WaitForMultipleObjects
+ // This will acquire <this->lock_> on success On failure, the
+ // lock will not be acquired
+ result = this->ok_to_wait (max_wait_time, alertable);
+ if (result != 1)
+ return result;
- // Increment the number of active threads
- this->active_threads_++;
+ // Increment the number of active threads
+ this->active_threads_++;
- // Release the <lock_>
- this->lock_.release ();
+ // Release the <lock_>
+ this->lock_.release ();
- // Update the countdown to reflect time waiting to play with the
- // mut and event.
- countdown.update ();
+ // Update the countdown to reflect time waiting to play with the
+ // mut and event.
+ countdown.update ();
- do
- {
// Calculate timeout
int timeout = this->calculate_timeout (max_wait_time);