[ace-users] timer behavior change with ACE 5.5
James DeCocq (jadecocq)
jadecocq at cisco.com
Thu Jun 21 17:22:53 CDT 2007
ACE VERSION: 5.5.8
HOST MACHINE and OPERATING SYSTEM:
HPxw4400 Intel Core2 6600 2GB; XP Pro SP2
TARGET MACHINE and OPERATING SYSTEM,
same
THE $ACE_ROOT/ace/config.h FILE
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
// #define ACE_NTRACE 0
#include "ace/config-win32.h"
MSVC++, Visual Studio 2005
AREA/CLASS/EXAMPLE AFFECTED:
Timers, ACE_Reactor
DOES THE PROBLEM AFFECT:
COMPILATION? no
LINKING? no
EXECUTION? yes
[Please indicate whether ACE, your application, or both are
affected.]
seemingly both
SYNOPSIS:
We are upgrading to latest ACE 5.5 while moving our project to
VS2005.
Timers work only sporadically in our application after upgrade to
5.5.
The code has been running succesfully for years under ACE 5.4 and
before.
*** Any suggestions of potential causes, fixes, or areas of
examination
*** are much appreciated. Thanks very much.
DESCRIPTION:
None of the code is new, it has been working for 4 years, but
stopped
working with ACE 5.5.
1. An ACE_Task derived object handles timer functionality. The code
is
spread out and interspersed with app logic, so I'll paraphrase
it:
class ReactiveTask: public ACE_Task
{
virtual int svc();
virtual int handle_input(ACE_HANDLE);
ACE_Reactor* reaktor;
ACE_Reactor_Notification_Strategy* rns;
// etc.
};
int ReactiveTask::svc()
{
// ...
reaktor->owner(ACE_Thread::self());
rns = new ACE_Reactor_Notification_Strategy
(reaktor, this, ACE_Event_Handler::READ_MASK);
this->msg_queue()->notification_strategy(rns);
reaktor->run_reactor_event_loop();
}
2. A heartbeat timer is set.
...
ACE_Time_Value period(1);
timerID = reaktor->schedule_timer(this, userData, period,
period);
3. Now, on any particular execution of the app, the timer either
works
always or not at all. When not, the schedule_timer call is
successful,
but handle_timeout is not called. It sounds screwy, but on
launching the
app after a full release rebuild, timers may work as expected,
but then
after shutting down the app and restarting, will likely no longer
work.
Also curious, a debug build will not fail as easily.
4. Thanks very much for any suggestions you may have.
More information about the Ace-users
mailing list