diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/OS.h | 7 | ||||
-rw-r--r-- | ace/Timer_Queue_T.h | 41 | ||||
-rw-r--r-- | ace/config-hpux-11.00.h | 8 | ||||
-rw-r--r-- | ace/config-hpux11.h | 7 | ||||
-rw-r--r-- | ace/config-irix6.x-common.h | 4 | ||||
-rw-r--r-- | ace/config-linux-common.h | 4 | ||||
-rw-r--r-- | ace/config-lynxos.h | 5 | ||||
-rw-r--r-- | ace/config-osf1-4.0.h | 5 | ||||
-rw-r--r-- | ace/config-pharlap.h | 5 | ||||
-rw-r--r-- | ace/config-sunos4-g++.h | 10 | ||||
-rw-r--r-- | ace/config-sunos4-lucid3.2.h | 10 | ||||
-rw-r--r-- | ace/config-sunos4-sun3.x.h | 10 | ||||
-rw-r--r-- | ace/config-sunos4-sun4.1.4.h | 10 | ||||
-rw-r--r-- | ace/config-sunos4-sun4.x-orbix.h | 10 | ||||
-rw-r--r-- | ace/config-sunos5.4-centerline-2.x.h | 10 | ||||
-rw-r--r-- | ace/config-sunos5.4-g++.h | 10 | ||||
-rw-r--r-- | ace/config-sunos5.4-sunc++-4.x-orbix.h | 10 | ||||
-rw-r--r-- | ace/config-sunos5.4-sunc++-4.x.h | 10 | ||||
-rw-r--r-- | ace/config-sunos5.5.h | 5 | ||||
-rw-r--r-- | ace/config-tandem.h | 4 |
20 files changed, 42 insertions, 143 deletions
@@ -969,12 +969,13 @@ private: # define ACE_DEFAULT_BASE_ADDR ((char *) (64 * 1024 * 1024)) # endif /* ACE_DEFAULT_BASE_ADDR */ + // This fudge factor can be overriden for timers that need it, such as on // Solaris, by defining the ACE_TIMER_SKEW symbol in the appropriate config // header. -# if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 0 -# endif /* ACE_TIMER_SKEW */ +#if !defined (ACE_TIMER_SKEW) +# define ACE_TIMER_SKEW 0 +#endif /* ACE_TIMER_SKEW */ // This needs to go here *first* to avoid problems with AIX. # if defined (ACE_HAS_PTHREADS) diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h index ab665d358ee..9e933b7171a 100644 --- a/ace/Timer_Queue_T.h +++ b/ace/Timer_Queue_T.h @@ -288,17 +288,50 @@ public: /** * Get the dispatch information for a timer whose value is <= <cur_time>. - * This does not account for <timer_skew>. Returns 1 if there is a - * node whose value <= <cur_time> else returns a 0. + * This does not account for <timer_skew>. Returns 1 if + * there is a node whose value <= <cur_time> else returns a 0. + * */ int dispatch_info (const ACE_Time_Value ¤t_time, ACE_Timer_Node_Dispatch_Info_T<TYPE> &info); /** * Run the <functor> for all timers whose values are <= - * <ACE_OS::gettimeofday>. Also accounts for <timer_skew>. Returns - * the number of timers canceled. + * <ACE_OS::gettimeofday>. Also accounts for <timer_skew>. + * + * Depending on the resolution of the underlying OS the system calls + * like select()/poll() might return at time different than that is + * specified in the timeout. Suppose the OS guarantees a resolution of t ms. + * The timeline will look like + * + * A B + * | | + * V V + * |-------------|-------------|-------------|-------------| + * t t t t t + * + * + * If you specify a timeout value of A, then the timeout will not occur + * at A but at the next interval of the timer, which is later than + * that is expected. Similarly, if your timeout value is equal to B, + * then the timeout will occur at interval after B. Now depending upon the + * resolution of your timeouts and the accuracy of the timeouts + * needed for your application, you should set the value of + * <timer_skew>. In the above case, if you want the timeout A to fire + * no later than A, then you should specify your <timer_skew> to be + * A % t. + * + * The timeout value should be specified via the macro ACE_TIMER_SKEW + * in your config.h file. The default value is zero. + * + * Things get interesting if the t before the timeout value B is zero + * i.e your timeout is less than the interval. In that case, you are + * almost sure of not getting the desired timeout behaviour. Maybe you + * should look for a better OS :-) + * + * Returns the number of timers canceled. */ + /* virtual */ int expire (void); /** diff --git a/ace/config-hpux-11.00.h b/ace/config-hpux-11.00.h index fd28673a939..9d3c9c3a8ba 100644 --- a/ace/config-hpux-11.00.h +++ b/ace/config-hpux-11.00.h @@ -57,7 +57,7 @@ # define volatile #else // aC++ definitions - + // Parts of TAO (at least) use __HP_aCC to detect this compiler, but the // macro is not set until A.03.13. If it's not set, set it - it won't be an // HP-advertised value, but we don't check the value/version - just whether @@ -321,12 +321,6 @@ // Platform lacks a typedef for timespec_t, but has struct timespec #define ACE_LACKS_TIMESPEC_T -// Platform needs a timer skew value. It *may* vary by processor, but this -// one works. You can override it in your config.h file if needed. -// It's in units of microseconds. This value is 10 msec. -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ // Shared library name/path components #define ACE_DLL_SUFFIX ".sl" diff --git a/ace/config-hpux11.h b/ace/config-hpux11.h index b449d59a5b1..992b96d1eb5 100644 --- a/ace/config-hpux11.h +++ b/ace/config-hpux11.h @@ -158,13 +158,6 @@ // Platform lacks a typedef for timespec_t, but has struct timespec #define ACE_LACKS_TIMESPEC_T -// Platform needs a timer skew value. It *may* vary by processor, but this -// one works. You can override it in your config.h file if needed. -// It's in units of microseconds. This value is 10 msec. -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - // Shared library name/path components #define ACE_DLL_SUFFIX ".sl" #if defined (__LP64__) diff --git a/ace/config-irix6.x-common.h b/ace/config-irix6.x-common.h index 419212687f2..6c01847b8ac 100644 --- a/ace/config-irix6.x-common.h +++ b/ace/config-irix6.x-common.h @@ -150,10 +150,6 @@ #define ACE_HAS_GPERF -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_NONCONST_SELECT_TIMEVAL #define ACE_HAS_BROKEN_DGRAM_SENDV diff --git a/ace/config-linux-common.h b/ace/config-linux-common.h index ae912abe80d..466294e5640 100644 --- a/ace/config-linux-common.h +++ b/ace/config-linux-common.h @@ -263,10 +263,6 @@ # define ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lu") #endif /* __ia64 */ -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) # define ACE_NTRACE 1 diff --git a/ace/config-lynxos.h b/ace/config-lynxos.h index d64943bc66b..e3282a40d59 100644 --- a/ace/config-lynxos.h +++ b/ace/config-lynxos.h @@ -158,11 +158,6 @@ // on SIG Proactor for this platform. // #define ACE_POSIX_SIG_PROACTOR -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK 1 // Turns off the tracing feature. diff --git a/ace/config-osf1-4.0.h b/ace/config-osf1-4.0.h index 66cb4f9f1ed..7666cf1b3c5 100644 --- a/ace/config-osf1-4.0.h +++ b/ace/config-osf1-4.0.h @@ -120,11 +120,6 @@ # define ACE_LACKS_SYSV_MSQ_PROTOS #endif /* _POSIX_C_SOURCE < 199506L */ -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) // NOTE: ACE_HAS_64BIT_LONGS is deprecated. Instead, use ACE_SIZEOF_LONG == 8. #define ACE_HAS_64BIT_LONGS diff --git a/ace/config-pharlap.h b/ace/config-pharlap.h index d8ebe03341f..374bed01b49 100644 --- a/ace/config-pharlap.h +++ b/ace/config-pharlap.h @@ -46,11 +46,6 @@ // the correct value. #define ACE_PAGE_SIZE 4096 -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - // Let the config-win32.h file do its thing #undef ACE_CONFIG_H #include "ace/config-win32.h" diff --git a/ace/config-sunos4-g++.h b/ace/config-sunos4-g++.h index 23924199d72..b1d5f485e00 100644 --- a/ace/config-sunos4-g++.h +++ b/ace/config-sunos4-g++.h @@ -20,11 +20,6 @@ // Maybe it will work? #undef ACE_HAS_TEMPLATE_SPECIALIZATION -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_LACKS_SYSTIME_H @@ -92,11 +87,6 @@ #define ACE_LACKS_DIFFTIME #define ACE_HAS_DIRENT -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -#define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_SUNOS4_SIGNAL_T #define ACE_HAS_CPLUSPLUS_HEADERS #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6)) diff --git a/ace/config-sunos4-lucid3.2.h b/ace/config-sunos4-lucid3.2.h index fe723d7db6b..e0738e124a8 100644 --- a/ace/config-sunos4-lucid3.2.h +++ b/ace/config-sunos4-lucid3.2.h @@ -11,11 +11,6 @@ #define ACE_LACKS_GETPGID #define ACE_LACKS_SETPGID -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_SYS_ERRLIST @@ -91,11 +86,6 @@ #define ACE_LACKS_DIFFTIME -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -#define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) #define ACE_NTRACE 1 diff --git a/ace/config-sunos4-sun3.x.h b/ace/config-sunos4-sun3.x.h index 9115692b70b..88acc3e5ded 100644 --- a/ace/config-sunos4-sun3.x.h +++ b/ace/config-sunos4-sun3.x.h @@ -9,11 +9,6 @@ #define ACE_LACKS_GETPGID #define ACE_LACKS_SETPGID -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_LACKS_POSIX_PROTOTYPES @@ -84,11 +79,6 @@ #define ACE_LACKS_DIFFTIME -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -#define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) #define ACE_NTRACE 1 diff --git a/ace/config-sunos4-sun4.1.4.h b/ace/config-sunos4-sun4.1.4.h index 4d070ae887e..54ab33b2aa8 100644 --- a/ace/config-sunos4-sun4.1.4.h +++ b/ace/config-sunos4-sun4.1.4.h @@ -13,11 +13,6 @@ #define ACE_LACKS_SETREGID #define ACE_LACKS_SETREUID -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_CHARPTR_SPRINTF @@ -95,11 +90,6 @@ #define ACE_LACKS_DIFFTIME -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -#define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) #define ACE_NTRACE 1 diff --git a/ace/config-sunos4-sun4.x-orbix.h b/ace/config-sunos4-sun4.x-orbix.h index 8c5266605b7..98dab1ac8c0 100644 --- a/ace/config-sunos4-sun4.x-orbix.h +++ b/ace/config-sunos4-sun4.x-orbix.h @@ -11,11 +11,6 @@ #define ACE_LACKS_GETPGID #define ACE_LACKS_SETPGID -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_CHARPTR_SPRINTF @@ -94,11 +89,6 @@ #define ACE_LACKS_DIFFTIME -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -#define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) #define ACE_NTRACE 1 diff --git a/ace/config-sunos5.4-centerline-2.x.h b/ace/config-sunos5.4-centerline-2.x.h index 562dd5ff493..84a685f9153 100644 --- a/ace/config-sunos5.4-centerline-2.x.h +++ b/ace/config-sunos5.4-centerline-2.x.h @@ -13,11 +13,6 @@ // Platform supports pread() and pwrite() #define ACE_HAS_P_READ_WRITE -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT #define ACE_HAS_XPG4_MULTIBYTE_CHAR @@ -153,11 +148,6 @@ #define ACE_NEEDS_DEV_IO_CONVERSION -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) # define ACE_NTRACE 1 diff --git a/ace/config-sunos5.4-g++.h b/ace/config-sunos5.4-g++.h index 648557989db..3059e3c2aae 100644 --- a/ace/config-sunos5.4-g++.h +++ b/ace/config-sunos5.4-g++.h @@ -19,11 +19,6 @@ #include "ace/config-g++-common.h" #define ACE_HAS_GNU_CSTRING_H -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT // Platform supports pread() and pwrite() @@ -171,11 +166,6 @@ // Use the poll() event demultiplexor rather than select(). //#define ACE_USE_POLL -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) # define ACE_NTRACE 1 diff --git a/ace/config-sunos5.4-sunc++-4.x-orbix.h b/ace/config-sunos5.4-sunc++-4.x-orbix.h index fa44d1521e5..e908543be52 100644 --- a/ace/config-sunos5.4-sunc++-4.x-orbix.h +++ b/ace/config-sunos5.4-sunc++-4.x-orbix.h @@ -15,11 +15,6 @@ #define ACE_HAS_TEMPLATE_SPECIALIZATION -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT // Platform supports pread() and pwrite() @@ -179,11 +174,6 @@ #define ACE_NEEDS_DEV_IO_CONVERSION -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. #if !defined (ACE_NTRACE) # define ACE_NTRACE 1 diff --git a/ace/config-sunos5.4-sunc++-4.x.h b/ace/config-sunos5.4-sunc++-4.x.h index 76392130c56..7e09eb292f3 100644 --- a/ace/config-sunos5.4-sunc++-4.x.h +++ b/ace/config-sunos5.4-sunc++-4.x.h @@ -14,11 +14,6 @@ #define ACE_HAS_TEMPLATE_SPECIALIZATION -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - // Optimize ACE_Handle_Set for select(). #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT @@ -176,11 +171,6 @@ #define ACE_NEEDS_DEV_IO_CONVERSION -// 10 millisecond fudge factor to account for Solaris timers... -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 1000 * 10 -#endif /* ACE_TIMER_SKEW */ - // Turns off the tracing feature. // #define ACE_NTRACE 0 #if !defined (ACE_NTRACE) diff --git a/ace/config-sunos5.5.h b/ace/config-sunos5.5.h index f343a42dc18..005484a9dff 100644 --- a/ace/config-sunos5.5.h +++ b/ace/config-sunos5.5.h @@ -149,11 +149,6 @@ // have link problems with g++ or egcs on SunOS 5.5. #define ACE_HAS_REGEX -// Maximum compensation (10 ms) for early return from timed ::select (). -#if !defined (ACE_TIMER_SKEW) -# define ACE_TIMER_SKEW 10 * 1000 -#endif /* ACE_TIMER_SKEW */ - // Optimize ACE_Handle_Set for select(). #define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT diff --git a/ace/config-tandem.h b/ace/config-tandem.h index e1a3f96578e..f42b644a56d 100644 --- a/ace/config-tandem.h +++ b/ace/config-tandem.h @@ -226,10 +226,6 @@ //Automatically restart OS system // calls when EINTR occurs -// 10 millisecond fudge factor to account for Solaris timers... -//#if !defined (ACE_TIMER_SKEW) -//#define ACE_TIMER_SKEW 1000 * 10 -//#endif /* ACE_TIMER_SKEW */ // Platform supports the getrusage() system call. //#define ACE_HAS_GETRUSAGE |