[ace-users] EXECUTION: schedule_timer() stopped when system time is set to earlier time.

Granwehr Boris STAG Boris.Granwehr at stadlerrail.com
Wed Mar 7 03:10:36 CST 2018


Hello

Thanks for your help.

I have now solved it by setting a custom timer_queue with the Monotonic
Time Policy to the Reactor:

  ACE_Timer_Queue * tmq = 0;
  typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
                           ACE_Event_Handler_Handle_Timeout_Upcall,
                           ACE_SYNCH_RECURSIVE_MUTEX,
                           ACE_Monotonic_Time_Policy> timer_queue_type;
  ACE_NEW_RETURN (tmq, timer_queue_type (), 0); 
  ACE_Reactor::instance()->timer_queue(tmq);
  test_handler handler;
  ACE_Reactor::instance()->schedule_timer(&handler, (void *)0,        
                           ACE_Time_Value(0), ACE_Time_Value(1));
  ACE_Reactor::instance()->run_event_loop();

best regards
Boris

-------- Weitergeleitete Nachricht --------
Von: Johnny Willemsen <jwillemsen at remedy.nl>
Reply-to: <jwillemsen at remedy.nl>
An: Granwehr Boris STAG <Boris.Granwehr at stadlerrail.com>, ace-users at lis
t.isis.vanderbilt.edu <ace-users at list.isis.vanderbilt.edu>, Boris.Granw
ehr at stadlerrail.com
Betreff: [EXTERNAL] Re: [ace-users] EXECUTION: schedule_timer() stopped
when system time is set to earlier time.
Datum: Tue, 6 Mar 2018 18:55:05 +0100

Hi,

Yes, this is possible on some platforms, see for example
tests/Monotonic_Message_Queue_Test.cpp. See
docs/ACE-monotonic-timer.html for some more background.

Best regards,

Johnny Willemsen

Remedy IT
Postbus 81 | 6930 AB Westervoort | The Netherlands
http://www.remedy.nl

On 03/06/2018 05:55 PM, Granwehr Boris STAG wrote:
> 
> When using ACE_Reactor::schedule_timer() with interval, the calling
> of
> ACE_Event_Handler::handle_timeout() is stopped when the system time
> is
> set to an earlier time.
> 
> Is it possible to use the CLOCK_MONOTONIC instead of the
> CLOCK_REALTIME
> with the ACE_Reactor::schedule_timer() method?
> _______________________________________________
> ace-users mailing list
> ace-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/ace-users




More information about the ace-users mailing list