[ace-users] Question regarding timer IDs in ACE_Timer_Queue

Steve Huston shuston at riverace.com
Mon Jul 9 11:44:20 CDT 2007


Hi Alex,
 
As Doug indicated, a 0 timer ID is legit. I made some changes to
ACE_Timer_Heap about 6 years ago:
 
Wed May 23 15:55:21 2001  Steve Huston  <shuston at riverace.com>
 
        * ace/Containers_T.h: Fixed comment directing reader to
include
          ace/Unbounded_Queue.h (rather than _Set.h) for
ACE_Unbounded_Queue.
 
        * ace/Timer_Heap_T.{cpp h}: Changed the free IDs list from a
stack
          to a round-robin list. Newly-allocated IDs keep increasing
til
          there aren't any more, then wrap around to the lowest
numbered
          free ID and start again. This is a ease-of-use improvement
to
          help applications catch their timer-related errors easier,
          which is apparantly important, especially in multi-threaded
          applications.

which may explain this change.
 
-Steve

--
Steve Huston, Riverace Corporation
Would you like ACE to run great on your platform?
See http://www.riverace.com/sponsor.htm


-----Original Message-----
From: ace-users-bounces at cse.wustl.edu
[mailto:ace-users-bounces at cse.wustl.edu] On Behalf Of Alex Blate
Sent: Sunday, July 08, 2007 8:59 PM
To: ace-users at cse.wustl.edu
Subject: [ace-users] Question regarding timer IDs in ACE_Timer_Queue



ACE Users:

 

I am porting a large code base to a new compiler, 64-bit compliance,
etc., and, in so doing, I have upgraded from ACE 5.1.14 (circa 2001)
to ACE 5.5.x. I had some minor issues, but the port and ACE upgrade
have gone mercifully smoothly - a credit, no doubt, to the quality of
the ACE package and community.

 

Onto my question: Our code uses, inter alia, the ACE_Timer_Queue (via
ACE_Thread_Timer_Queue_Adapter, using Timer_Heap). Last week, I hit a
very nasty bug which "went away" when I made changes to a couple
places where we assumed that the timer IDs had to be strictly greater
than zero. Looking at the ACE code, I see no reason why timer IDs
can't be zero ( -1 is the "null" value, of course). OTOH, I have to
assume that there was a reason why our old code checked for ID > 0 and
I want to be sure that I'm not breaking something else :-)

 

Has the Timer_Queue implementation changed between 5.1 and 5.5 such
that in 5.1 timers were strictly positive and now they can have
zero-valued IDs? 

 

I just would like a sanity check in case my bug went away for some
other reason or, being timing-related, is just hiding from me. 

 

I did not fill out the PRF because I consider this a question about a
change in your underlying implementation, rather than a bug :-)

 

Alex Blate

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/ace-users/attachments/20070709/adda1c87/attachment.htm


More information about the Ace-users mailing list