summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-08-31 21:41:05 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-08-31 21:41:05 +0000
commit0e330f523c731699e8743d70c935d9b9bb46ed42 (patch)
treec4f2c6c638cfba3c556b8c5b7126af701f16ffcb /ace
parent67dc925059471f410120f8f36da14028e1104887 (diff)
downloadATCD-0e330f523c731699e8743d70c935d9b9bb46ed42.tar.gz
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r--ace/Handle_Set.cpp33
-rw-r--r--ace/OS.i18
-rw-r--r--ace/Timer_Queue_T.cpp107
-rw-r--r--ace/Timer_Queue_T.h42
-rw-r--r--ace/config-aix-3.2.5.h2
-rw-r--r--ace/config-aix-4.1.x.h3
-rw-r--r--ace/config-aix-4.2.x.h2
-rw-r--r--ace/config-chorus.h3
-rw-r--r--ace/config-dgux-4.11-epc.h3
-rw-r--r--ace/config-freebsd-pthread.h2
-rw-r--r--ace/config-freebsd.h3
-rw-r--r--ace/config-hpux-10.x-g++.h3
-rw-r--r--ace/config-hpux-10.x-hpc++.h3
-rw-r--r--ace/config-hpux-9.x-orbix.h2
-rw-r--r--ace/config-hpux-9.x.h2
-rw-r--r--ace/config-irix5.2.h2
-rw-r--r--ace/config-irix5.3-g++.h2
-rw-r--r--ace/config-irix5.3-sgic++.h3
-rw-r--r--ace/config-irix6.x-sgic++-nothreads.h3
-rw-r--r--ace/config-linux-lxpthreads.h3
-rw-r--r--ace/config-linux-pthread.h2
-rw-r--r--ace/config-linux.h5
-rw-r--r--ace/config-m88k.h3
-rw-r--r--ace/config-mvs.h3
-rw-r--r--ace/config-osf1-3.2.h3
-rw-r--r--ace/config-osf1-4.0-g++.h2
-rw-r--r--ace/config-osf1-4.0.h3
-rw-r--r--ace/config-sco-4.2-nothread.h3
-rw-r--r--ace/config-sco-5.0.0-fsu-pthread.h3
-rw-r--r--ace/config-sco-5.0.0-mit-pthread.h2
-rw-r--r--ace/config-sco-5.0.0-nothread.h2
-rw-r--r--ace/config-sunos4-g++.h2
-rw-r--r--ace/config-sunos4-lucid3.2.h2
-rw-r--r--ace/config-sunos4-sun3.x.h2
-rw-r--r--ace/config-sunos4-sun4.1.4.h2
-rw-r--r--ace/config-sunos4-sun4.x-orbix.h2
-rw-r--r--ace/config-sunos4-sun4.x.h3
-rw-r--r--ace/config-sunos5.4-centerline-2.x.h3
-rw-r--r--ace/config-sunos5.4-g++.h2
-rw-r--r--ace/config-sunos5.4-sunc++-4.x-orbix.h2
-rw-r--r--ace/config-sunos5.4-sunc++-4.x.h3
-rw-r--r--ace/config-sunos5.5-g++.h3
-rw-r--r--ace/config-sunos5.5-sunc++-4.x.h3
-rw-r--r--ace/config-sunx86-sunc++-4.x.h3
-rw-r--r--ace/config-tandem.h3
-rw-r--r--ace/config-unixware-2.01-g++.h3
-rw-r--r--ace/config-unixware-2.1.2-g++.h3
-rw-r--r--ace/config-vxworks-ghs-1.8.h3
-rw-r--r--ace/config-vxworks5.x-g++.h3
-rw-r--r--ace/config-win32-common.h3
50 files changed, 290 insertions, 32 deletions
diff --git a/ace/Handle_Set.cpp b/ace/Handle_Set.cpp
index b0000cce45f..f40b0e67578 100644
--- a/ace/Handle_Set.cpp
+++ b/ace/Handle_Set.cpp
@@ -79,43 +79,28 @@ ACE_Handle_Set::ACE_Handle_Set (const ACE_FD_SET_TYPE &fd_mask)
// Counts the number of bits enabled in N. Uses a table lookup to
// speed up the count.
-#if defined (ACE_HAS_LONG_FDMASK)
-// If there are platforms where fd_mask isn't typedef'd to a 4 byte
-// quantify we'll have to use the following code.
-
int
ACE_Handle_Set::count_bits (u_long n) const
{
- ACE_TRACE ("ACE_Handle_Set::count_bits");
- int rval = 0;
+
+ ACE_TRACE ("ACE_Handle_Set::count_bits");
+#if defined (ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT)
+ register int rval = 0;
while (n > 0)
{
-#if defined (ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT)
rval++;
n &= n - 1;
-#else
- rval += ACE_Handle_Set::nbits_[n & 0xff];
- n >>= 8;
-#endif /* ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT */
}
return rval;
-}
#else
-
-// Otherwise we can use the following.
-
-int
-ACE_Handle_Set::count_bits (u_long n) const
-{
- ACE_TRACE ("ACE_Handle_Set::count_bits");
- return (ACE_Handle_Set::nbits_[n & 0xff]
- + ACE_Handle_Set::nbits_[(n >> 8) & 0xff]
- + ACE_Handle_Set::nbits_[(n >> 16) & 0xff]
- + ACE_Handle_Set::nbits_[(n >> 24) & 0xff]);
+ return (ACE_Handle_Set::nbits_[n & 0xff]
+ + ACE_Handle_Set::nbits_[(n >> 8) & 0xff]
+ + ACE_Handle_Set::nbits_[(n >> 16) & 0xff]
+ + ACE_Handle_Set::nbits_[(n >> 24) & 0xff]);
+#endif /* ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT */
}
-#endif /* ACE_HAS_LONG_FDMASK */
// Synchronize the underlying FD_SET with the MAX_FD and the SIZE.
diff --git a/ace/OS.i b/ace/OS.i
index 57179097bce..865c0ae9f03 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -5441,7 +5441,7 @@ ACE_OS::msgrcv (int int_id, void *buf, size_t len,
{
// ACE_TRACE ("ACE_OS::msgrcv");
#if defined (ACE_HAS_SYSV_IPC)
-#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_LACKS_POSIX_PROTO_FOR_SOME_FUNCS)
+#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_LACKS_POSIX_PROTOTYPES_FOR_SOME_FUNCS)
ACE_OSCALL_RETURN (::msgrcv (int_id, (msgbuf *) buf, len, type, flags),
int, -1);
#else
@@ -5464,7 +5464,7 @@ ACE_OS::msgsnd (int int_id, const void *buf, size_t len, int flags)
{
// ACE_TRACE ("ACE_OS::msgsnd");
#if defined (ACE_HAS_SYSV_IPC)
-#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_HAS_NONCONST_MSGSND) || defined (ACE_LACKS_POSIX_PROTO_FOR_SOME_FUNCS)
+#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_HAS_NONCONST_MSGSND) || defined (ACE_LACKS_POSIX_PROTOTYPES_FOR_SOME_FUNCS)
ACE_OSCALL_RETURN (::msgsnd (int_id, (msgbuf *) buf, len, flags), int, -1);
#else
ACE_OSCALL_RETURN (::msgsnd (int_id, buf, len, flags), int, -1);
@@ -5500,10 +5500,12 @@ ACE_OS::ualarm (u_int usecs, u_int interval)
#if defined (ACE_HAS_UALARM)
return ::ualarm (usecs, interval);
+#elif !defined (ACE_LACKS_UNIX_SIGNALS)
+ ACE_UNUSED_ARG (interval);
+ return ::alarm (usecs * 1000000);
#else
ACE_UNUSED_ARG (usecs);
ACE_UNUSED_ARG (interval);
-
ACE_NOTSUP_RETURN (0);
#endif /* ACE_HAS_UALARM */
}
@@ -5518,10 +5520,12 @@ ACE_OS::ualarm (const ACE_Time_Value &tv,
u_int usecs = (tv.sec () * 1000000) + tv.usec ();
u_int interval = (tv_interval.sec () * 1000000) + tv_interval.usec ();
return ::ualarm (usecs, interval);
+#elif !defined (ACE_LACKS_UNIX_SIGNALS)
+ ACE_UNUSED_ARG (tv_interval);
+ return ::alarm (tv.sec ());
#else
- ACE_UNUSED_ARG (tv);
ACE_UNUSED_ARG (tv_interval);
-
+ ACE_UNUSED_ARG (tv);
ACE_NOTSUP_RETURN (0);
#endif /* ACE_HAS_UALARM */
}
@@ -6097,7 +6101,7 @@ ACE_OS::shmat (int int_id, void *shmaddr, int shmflg)
{
// ACE_TRACE ("ACE_OS::shmat");
#if defined (ACE_HAS_SYSV_IPC)
-#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_LACKS_POSIX_PROTO_FOR_SOME_FUNCS)
+#if defined (ACE_LACKS_POSIX_PROTOTYPES) || defined (ACE_LACKS_POSIX_PROTOTYPES_FOR_SOME_FUNCS)
ACE_OSCALL_RETURN (::shmat (int_id, (char *)shmaddr, shmflg), void *, (void *) -1);
#else
ACE_OSCALL_RETURN (::shmat (int_id, shmaddr, shmflg), void *, (void *) -1);
@@ -7104,7 +7108,7 @@ ACE_OS::sigaction (int signum,
return osa->sa_handler == SIG_ERR ? -1 : 0;
#elif defined (CHORUS)
ACE_NOTSUP_RETURN (-1);
-#elif defined (ACE_LACKS_POSIX_PROTOTYPES) || defined(ACE_LACKS_POSIX_PROTO_FOR_SOME_FUNCS)
+#elif defined (ACE_LACKS_POSIX_PROTOTYPES) || defined(ACE_LACKS_POSIX_PROTOTYPES_FOR_SOME_FUNCS)
ACE_OSCALL_RETURN (::sigaction (signum, (struct sigaction*) nsa, osa), int, -1);
#else
ACE_OSCALL_RETURN (::sigaction (signum, nsa, osa), int, -1);
diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp
index 06d5a3c75f8..d17b7065fd5 100644
--- a/ace/Timer_Queue_T.cpp
+++ b/ace/Timer_Queue_T.cpp
@@ -5,6 +5,7 @@
#define ACE_BUILD_DLL
#include "ace/Synch.h"
+#include "ace/Signal.h"
#include "ace/Timer_Queue_T.h"
#if !defined (__ACE_INLINE__)
@@ -279,4 +280,110 @@ ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::deletion (ACE_Timer_Queue_T<A
return 0;
}
+template <class TQ> TQ &
+ACE_Async_Timer_Queue_Adapter<TQ>::timer_queue (void)
+{
+ return this->timer_queue_;
+}
+
+template <class TQ> int
+ACE_Async_Timer_Queue_Adapter<TQ>::cancel (long timer_id,
+ const void **act)
+{
+ // Block all signals.
+ ACE_Sig_Guard sg;
+ ACE_UNUSED_ARG (sg);
+
+ return this->timer_queue_.cancel (timer_id, act);
+}
+
+template <class TQ> long
+ACE_Async_Timer_Queue_Adapter<TQ>::schedule (ACE_Event_Handler *eh,
+ const void *act,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval)
+{
+ // Block all signals.
+ ACE_Sig_Guard sg;
+ ACE_UNUSED_ARG (sg);
+
+ long tid = this->timer_queue_.schedule (eh, 0, delay);
+
+ if (tid == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1);
+
+ ACE_Time_Value tv = this->timer_queue_.earliest_time ()
+ - ACE_OS::gettimeofday ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "scheduling timer %d for (%d, %d)\n",
+ tid, tv.sec (), tv.usec ()));
+
+ // Beware of negative times and zero times (which cause problems for
+ // ualarm()).
+ if (tv < ACE_Time_Value::zero)
+ tv = ACE_Time_Value (0, 1);
+
+ // Schedule a new timer.
+ ACE_OS::ualarm (tv);
+ return 0;
+}
+
+template <class TQ>
+ACE_Async_Timer_Queue_Adapter<TQ>::ACE_Async_Timer_Queue_Adapter (void)
+{
+ // The following code is necessary to selectively "block" all
+ // signals when SIGALRM is running. Also, we always restart system
+ // calls that are interrupted by the signals.
+
+ // Block *all* signals when the SIGARLM handler is running!
+ ACE_Sig_Set ss (1);
+
+ ACE_Sig_Action sa ((ACE_SignalHandler) 0,
+ ss,
+ SA_RESTART);
+
+ if (this->sig_handler_.register_handler (SIGALRM, this, &sa) == -1)
+ ACE_ERROR ((LM_ERROR, "%p\n", "register_handler"));
+}
+
+// This is the signal handler function for the asynchronous timer
+// list. It gets invoked asynchronously when the SIGALRM signal
+// occurs.
+template <class TQ> int
+ACE_Async_Timer_Queue_Adapter<TQ>::handle_signal (int signum,
+ siginfo_t *,
+ ucontext_t *)
+{
+ ACE_DEBUG ((LM_DEBUG, "handling signal %S\n", signum));
+
+ switch (signum)
+ {
+ case SIGALRM:
+ {
+ int expired_timers;
+
+ // Expire the pending timers.
+ expired_timers = this->timer_queue_.expire ();
+
+ if (expired_timers > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "time = %d, timers expired = %d\n",
+ ACE_OS::time (),
+ expired_timers));
+
+ // Only schedule a new timer if there is one in the list.
+ if (this->timer_queue_.is_empty () == 0)
+ ACE_OS::ualarm (this->timer_queue_.earliest_time ()
+ - ACE_OS::gettimeofday ());
+
+ return 0;
+ /* NOTREACHED */
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR, "unexpected signal %S\n", signum), -1);
+ /* NOTREACHED */
+ }
+}
+
#endif /* ACE_TIMER_QUEUE_T_C*/
diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h
index a45a3957641..b9e30563bb9 100644
--- a/ace/Timer_Queue_T.h
+++ b/ace/Timer_Queue_T.h
@@ -349,6 +349,48 @@ public:
// the timer is still contained in it
};
+template <class TQ>
+class ACE_Async_Timer_Queue_Adapter : public ACE_Event_Handler
+ // = TITLE
+ // Adapts a <TQ> to be run asynchronously.
+ //
+ // = DESCRIPTION
+ // This implementation uses the <ualarm> call, which generates
+ // the SIGARLM signal that is caught by this class.
+{
+public:
+ typedef TQ TIMER_QUEUE;
+
+ ACE_Async_Timer_Queue_Adapter (void);
+ // Register the SIGALRM handler.
+
+ long schedule (ACE_Event_Handler *type,
+ const void *act,
+ const ACE_Time_Value &delay,
+ const ACE_Time_Value &interval = ACE_Time_Value::zero);
+ // Schedule the timer according to the semantics of the
+ // <ACE_Timer_List>. However, this timer gets dispatched via a
+ // signal, rather than by a user calling <expire>.
+
+ int cancel (long timer_id, const void **);
+ // Cancel the <timer_id>.
+
+ TQ &timer_queue (void);
+ // Access the underlying <TIMER_QUEUE>.
+
+private:
+ virtual int handle_signal (int signum, siginfo_t *, ucontext_t *);
+ // Called back by SIGALRM handler.
+
+ ACE_Sig_Handler sig_handler_;
+ // Handler for the SIGALRM signal, so that we can access our state
+ // without requiring global variables.
+
+ TQ timer_queue_;
+ // Implementation of the timer queue (e.g., <ACE_Timer_List>,
+ // <ACE_Timer_Heap>, etc.).
+};
+
#if defined (__ACE_INLINE__)
#include "ace/Timer_Queue_T.i"
#endif /* __ACE_INLINE__ */
diff --git a/ace/config-aix-3.2.5.h b/ace/config-aix-3.2.5.h
index 2ab73303c56..40b1450281b 100644
--- a/ace/config-aix-3.2.5.h
+++ b/ace/config-aix-3.2.5.h
@@ -22,6 +22,8 @@
#define ACE_HAS_AIX_GETTIMEOFDAY
#define ACE_HAS_NO_SYSCALL_H
#define ACE_NEEDS_DEV_IO_CONVERSION
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Compiler/platform has the getrusage() system call.
#define ACE_HAS_GETRUSAGE
diff --git a/ace/config-aix-4.1.x.h b/ace/config-aix-4.1.x.h
index 2b6b36b7972..556079daded 100644
--- a/ace/config-aix-4.1.x.h
+++ b/ace/config-aix-4.1.x.h
@@ -22,6 +22,9 @@
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#define ACE_HAS_UNION_WAIT
#define ACE_HAS_TID_T
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_SIGWAIT
#define ACE_HAS_H_ERRNO
#define ACE_LACKS_SETSCHED
diff --git a/ace/config-aix-4.2.x.h b/ace/config-aix-4.2.x.h
index faf51a7cbc1..6670975b9df 100644
--- a/ace/config-aix-4.2.x.h
+++ b/ace/config-aix-4.2.x.h
@@ -33,6 +33,8 @@
#define ACE_HAS_LONGLONG_T
#define ACE_TEMPLATES_REQUIRE_PRAGMA
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
#define ACE_HAS_AIX_HI_RES_TIMER
diff --git a/ace/config-chorus.h b/ace/config-chorus.h
index 05db555d987..d3a4ed92e0f 100644
--- a/ace/config-chorus.h
+++ b/ace/config-chorus.h
@@ -16,6 +16,9 @@
#undef linux
#endif
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_TEMPLATE_SPECIALIZATION
#define ACE_LACKS_UNIX_SIGNALS
#define ACE_HAS_IP_MULTICAST
diff --git a/ace/config-dgux-4.11-epc.h b/ace/config-dgux-4.11-epc.h
index 058b8ebbfbb..a4ed3c54048 100644
--- a/ace/config-dgux-4.11-epc.h
+++ b/ace/config-dgux-4.11-epc.h
@@ -188,5 +188,8 @@
// Header files lack t_errno for ACE_TLI.
#define ACE_LACKS_T_ERRNO
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_DGUX
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-freebsd-pthread.h b/ace/config-freebsd-pthread.h
index e034ec91511..baea6c6915c 100644
--- a/ace/config-freebsd-pthread.h
+++ b/ace/config-freebsd-pthread.h
@@ -22,6 +22,8 @@
#define ACE_LACKS_GETPGID
#define ACE_LACKS_RWLOCK_T
#define ACE_HAS_SIG_MACROS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_CHARPTR_DL
#define ACE_USES_ASM_SYMBOL_IN_DLSYM
#define ACE_LACKS_SIGSET
diff --git a/ace/config-freebsd.h b/ace/config-freebsd.h
index 4da0e3c3aa5..6ebcac87459 100644
--- a/ace/config-freebsd.h
+++ b/ace/config-freebsd.h
@@ -169,4 +169,7 @@ ange */
// #define ACE_HAS_SIGWAIT
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-hpux-10.x-g++.h b/ace/config-hpux-10.x-g++.h
index 45d82e6a52b..0cb2e7d90ed 100644
--- a/ace/config-hpux-10.x-g++.h
+++ b/ace/config-hpux-10.x-g++.h
@@ -117,6 +117,9 @@
// Platform supports ACE_TLI.
#define ACE_HAS_TLI
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Turns off the tracing feature.
#if !defined (ACE_NTRACE)
#define ACE_NTRACE 1
diff --git a/ace/config-hpux-10.x-hpc++.h b/ace/config-hpux-10.x-hpc++.h
index 7f9c4aa874b..94a769ff225 100644
--- a/ace/config-hpux-10.x-hpc++.h
+++ b/ace/config-hpux-10.x-hpc++.h
@@ -74,6 +74,9 @@
#define ACE_HAS_SSIZE_T
#define ACE_HAS_UALARM
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#include "ace/config-hpux-10.x.h" /* OS information */
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-hpux-9.x-orbix.h b/ace/config-hpux-9.x-orbix.h
index ff421831cf8..35fc136edc2 100644
--- a/ace/config-hpux-9.x-orbix.h
+++ b/ace/config-hpux-9.x-orbix.h
@@ -17,6 +17,8 @@
#endif /* __cplusplus < 199707L */
#define ACE_HAS_BROKEN_CONVERSIONS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// They forgot a const in the prototype of const_timewait...
#define ACE_LACKS_CONST_TIMESPEC_PTR
diff --git a/ace/config-hpux-9.x.h b/ace/config-hpux-9.x.h
index 6ec331e3dee..c155b89c1e9 100644
--- a/ace/config-hpux-9.x.h
+++ b/ace/config-hpux-9.x.h
@@ -20,6 +20,8 @@
#define ACE_HAS_IP_MULTICAST
#define ACE_LACKS_GETPGID
#define ACE_HAS_BROKEN_CONVERSIONS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// They forgot a const in the prototype of const_timewait...
#define ACE_LACKS_CONST_TIMESPEC_PTR
diff --git a/ace/config-irix5.2.h b/ace/config-irix5.2.h
index da4b26a020e..b9e74f13d1b 100644
--- a/ace/config-irix5.2.h
+++ b/ace/config-irix5.2.h
@@ -15,6 +15,8 @@
// Platform supports getpagesize() call.
#define ACE_HAS_GETPAGESIZE
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_SIGWAIT
diff --git a/ace/config-irix5.3-g++.h b/ace/config-irix5.3-g++.h
index c090dccf236..32de4c89ea1 100644
--- a/ace/config-irix5.3-g++.h
+++ b/ace/config-irix5.3-g++.h
@@ -14,6 +14,8 @@
#define ACE_HAS_SIGWAIT
#define ACE_TEMPLATES_REQUIRE_SOURCE
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_TEMPLATE_SPECIALIZATION
#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
diff --git a/ace/config-irix5.3-sgic++.h b/ace/config-irix5.3-sgic++.h
index 86e81008c72..66e5d93aa7d 100644
--- a/ace/config-irix5.3-sgic++.h
+++ b/ace/config-irix5.3-sgic++.h
@@ -13,6 +13,9 @@
#include <sys/bsd_types.h>
#define _BSD_TYPES
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform supports getpagesize() call.
#define ACE_HAS_GETPAGESIZE
diff --git a/ace/config-irix6.x-sgic++-nothreads.h b/ace/config-irix6.x-sgic++-nothreads.h
index d599ebbb741..f60facd1748 100644
--- a/ace/config-irix6.x-sgic++-nothreads.h
+++ b/ace/config-irix6.x-sgic++-nothreads.h
@@ -42,6 +42,9 @@
// functions).
#define ACE_HAS_REENTRANT_FUNCTIONS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform does not support reentrant password file accessor functiions.
#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS
diff --git a/ace/config-linux-lxpthreads.h b/ace/config-linux-lxpthreads.h
index 0f3d25adf9e..f294352ced6 100644
--- a/ace/config-linux-lxpthreads.h
+++ b/ace/config-linux-lxpthreads.h
@@ -48,6 +48,9 @@
#define msg_accrightslen msg_controllen
#endif
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_POSIX_TIME
// Platform defines struct timespec but not timespec_t
diff --git a/ace/config-linux-pthread.h b/ace/config-linux-pthread.h
index e1db4eb3ce4..d4d859b3205 100644
--- a/ace/config-linux-pthread.h
+++ b/ace/config-linux-pthread.h
@@ -15,6 +15,8 @@
#define ACE_HAS_PENTIUM
#define ACE_HAS_LONGLONG_T
#define ACE_HAS_STRING_CLASS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Fixes a problem with new versions of Linux...
#ifndef msg_accrights
diff --git a/ace/config-linux.h b/ace/config-linux.h
index 54e7ed2c4fc..f390d9393b8 100644
--- a/ace/config-linux.h
+++ b/ace/config-linux.h
@@ -12,12 +12,15 @@
#endif /* ! __ACE_INLINE__ */
// Do we really need this #define here?
-#define LINUX 2.0.29
+#define LINUX
// ONLY define this if you have config'd multicast into a 2.x kernel.
// If you do anything else, we've never tested it!
#define ACE_HAS_IP_MULTICAST
#define ACE_HAS_LONG_FDMASK
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_PENTIUM
#define ACE_HAS_LONGLONG_T
#define ACE_HAS_STRING_CLASS
diff --git a/ace/config-m88k.h b/ace/config-m88k.h
index aa506234bde..e52bc243305 100644
--- a/ace/config-m88k.h
+++ b/ace/config-m88k.h
@@ -19,6 +19,9 @@ extern "C" void pthread_init();
#define PTHREAD_STACK_MIN 1024
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#if !defined (IP_ADD_MEMBERSHIP)
#define IP_ADD_MEMBERSHIP 0x13
#endif /* m88k */
diff --git a/ace/config-mvs.h b/ace/config-mvs.h
index fd3d8e3d319..2832d6f6140 100644
--- a/ace/config-mvs.h
+++ b/ace/config-mvs.h
@@ -19,6 +19,9 @@
#undef log /* conflicts with log function in ACE */
#endif /* log */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// See the README file in this directory
// for a description of the following ACE_ macros
diff --git a/ace/config-osf1-3.2.h b/ace/config-osf1-3.2.h
index fea4084027a..c03309199b6 100644
--- a/ace/config-osf1-3.2.h
+++ b/ace/config-osf1-3.2.h
@@ -16,6 +16,9 @@
#define ACE_HAS_BROKEN_MSG_H
#define ACE_LACKS_SYSV_MSQ_PROTOS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform supports <sys/procfs.h>
#define ACE_HAS_PROC_FS
diff --git a/ace/config-osf1-4.0-g++.h b/ace/config-osf1-4.0-g++.h
index 1124dad7ff9..cad043dbdaa 100644
--- a/ace/config-osf1-4.0-g++.h
+++ b/ace/config-osf1-4.0-g++.h
@@ -24,6 +24,8 @@
#define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION
#define ACE_HAS_TEMPLATE_SPECIALIZATION
#define ACE_HAS_UALARM
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Compiler's template mechanism must see source code (i.e., .C
// files).
diff --git a/ace/config-osf1-4.0.h b/ace/config-osf1-4.0.h
index a12dfebe8a5..e71577fb1c3 100644
--- a/ace/config-osf1-4.0.h
+++ b/ace/config-osf1-4.0.h
@@ -16,6 +16,9 @@
// DEC's CXX supports explicit template specialization.
#define ACE_HAS_TEMPLATE_SPECIALIZATION
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_POLL_IS_BROKEN
#define ACE_HAS_STRING_CLASS
#define ACE_LACKS_LINEBUFFERED_STREAMBUF
diff --git a/ace/config-sco-4.2-nothread.h b/ace/config-sco-4.2-nothread.h
index b9573b2ce03..c4989e01efc 100644
--- a/ace/config-sco-4.2-nothread.h
+++ b/ace/config-sco-4.2-nothread.h
@@ -16,6 +16,9 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#if defined (SCO) && !defined (MAXPATHLEN)
#define MAXPATHLEN 1023
#endif /* SCO */
diff --git a/ace/config-sco-5.0.0-fsu-pthread.h b/ace/config-sco-5.0.0-fsu-pthread.h
index b619e407d3c..7b0ef537c30 100644
--- a/ace/config-sco-5.0.0-fsu-pthread.h
+++ b/ace/config-sco-5.0.0-fsu-pthread.h
@@ -16,6 +16,9 @@
#define MAXPATHLEN 1023
#endif /* SCO */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_SIG_MACROS
#define ACE_LACKS_CONST_TIMESPEC_PTR
#define ACE_TEMPLATES_REQUIRE_SOURCE
diff --git a/ace/config-sco-5.0.0-mit-pthread.h b/ace/config-sco-5.0.0-mit-pthread.h
index 281bff9ab9a..db784b0f4c3 100644
--- a/ace/config-sco-5.0.0-mit-pthread.h
+++ b/ace/config-sco-5.0.0-mit-pthread.h
@@ -15,6 +15,8 @@
#endif /* SCO */
#define ACE_HAS_SIG_MACROS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#if defined (SCO) && !defined (MAXPATHLEN)
#define MAXPATHLEN 1023
diff --git a/ace/config-sco-5.0.0-nothread.h b/ace/config-sco-5.0.0-nothread.h
index 2b6c38336d5..d0289247c40 100644
--- a/ace/config-sco-5.0.0-nothread.h
+++ b/ace/config-sco-5.0.0-nothread.h
@@ -13,6 +13,8 @@
#endif /* SCO */
#define ACE_HAS_SIG_MACROS
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#if defined (SCO) && !defined (MAXPATHLEN)
#define MAXPATHLEN 1023
diff --git a/ace/config-sunos4-g++.h b/ace/config-sunos4-g++.h
index 719181b63ca..3fb861b1a25 100644
--- a/ace/config-sunos4-g++.h
+++ b/ace/config-sunos4-g++.h
@@ -11,6 +11,8 @@
#endif /* ! __ACE_INLINE__ */
#define ACE_HAS_BROKEN_EXPLICIT_TEMPLATE_DESTRUCTOR
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_STRING_CLASS
#define ACE_NEEDS_SYSTIME_H
diff --git a/ace/config-sunos4-lucid3.2.h b/ace/config-sunos4-lucid3.2.h
index 9f36654eee6..1df467ccbcf 100644
--- a/ace/config-sunos4-lucid3.2.h
+++ b/ace/config-sunos4-lucid3.2.h
@@ -8,6 +8,8 @@
#define ACE_CONFIG_H
#define ACE_LACKS_GETPGID
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_SYS_ERRLIST
#define ACE_HAS_CHARPTR_SPRINTF
diff --git a/ace/config-sunos4-sun3.x.h b/ace/config-sunos4-sun3.x.h
index 5039823c901..bc0e6b98392 100644
--- a/ace/config-sunos4-sun3.x.h
+++ b/ace/config-sunos4-sun3.x.h
@@ -7,6 +7,8 @@
#if !defined (ACE_CONFIG_H)
#define ACE_LACKS_GETPGID
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_LACKS_POSIX_PROTOTYPES
#define ACE_HAS_UNION_WAIT
diff --git a/ace/config-sunos4-sun4.1.4.h b/ace/config-sunos4-sun4.1.4.h
index 0c817a32ff7..47a57826875 100644
--- a/ace/config-sunos4-sun4.1.4.h
+++ b/ace/config-sunos4-sun4.1.4.h
@@ -8,6 +8,8 @@
#define ACE_CONFIG_H
#define ACE_LACKS_GETPGID
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_CHARPTR_SPRINTF
#define ACE_NEEDS_SYSTIME_H
diff --git a/ace/config-sunos4-sun4.x-orbix.h b/ace/config-sunos4-sun4.x-orbix.h
index f5584ee296a..b3efead4bc9 100644
--- a/ace/config-sunos4-sun4.x-orbix.h
+++ b/ace/config-sunos4-sun4.x-orbix.h
@@ -8,6 +8,8 @@
#define ACE_CONFIG_H
#define ACE_LACKS_GETPGID
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_CHARPTR_SPRINTF
#define ACE_HAS_UNION_WAIT
diff --git a/ace/config-sunos4-sun4.x.h b/ace/config-sunos4-sun4.x.h
index 3148f3c6fdb..7d6f480b037 100644
--- a/ace/config-sunos4-sun4.x.h
+++ b/ace/config-sunos4-sun4.x.h
@@ -14,6 +14,9 @@
#define ACE_LACKS_POSIX_PROTOTYPES
// #define ACE_HAS_UNION_WAIT
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
diff --git a/ace/config-sunos5.4-centerline-2.x.h b/ace/config-sunos5.4-centerline-2.x.h
index be82c2f4fd8..9d0dc65159a 100644
--- a/ace/config-sunos5.4-centerline-2.x.h
+++ b/ace/config-sunos5.4-centerline-2.x.h
@@ -14,6 +14,9 @@
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_UNICODE
// Platform supports System V IPC (most versions of UNIX, but not Win32)
diff --git a/ace/config-sunos5.4-g++.h b/ace/config-sunos5.4-g++.h
index 3f8134fb608..63d9f70052e 100644
--- a/ace/config-sunos5.4-g++.h
+++ b/ace/config-sunos5.4-g++.h
@@ -12,6 +12,8 @@
#endif /* ! __ACE_INLINE__ */
#define ACE_HAS_BROKEN_EXPLICIT_TEMPLATE_DESTRUCTOR
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
#define ACE_HAS_STRING_CLASS
#define ACE_HAS_TEMPLATE_SPECIALIZATION
diff --git a/ace/config-sunos5.4-sunc++-4.x-orbix.h b/ace/config-sunos5.4-sunc++-4.x-orbix.h
index 317383cbfad..58bff56d5d0 100644
--- a/ace/config-sunos5.4-sunc++-4.x-orbix.h
+++ b/ace/config-sunos5.4-sunc++-4.x-orbix.h
@@ -13,6 +13,8 @@
#endif /* ! __ACE_INLINE__ */
#define ACE_HAS_TEMPLATE_SPECIALIZATION
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
diff --git a/ace/config-sunos5.4-sunc++-4.x.h b/ace/config-sunos5.4-sunc++-4.x.h
index e7e8e577cbc..657a959e17b 100644
--- a/ace/config-sunos5.4-sunc++-4.x.h
+++ b/ace/config-sunos5.4-sunc++-4.x.h
@@ -13,6 +13,9 @@
#define ACE_HAS_TEMPLATE_SPECIALIZATION
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
diff --git a/ace/config-sunos5.5-g++.h b/ace/config-sunos5.5-g++.h
index 2ff888accc7..1e311774119 100644
--- a/ace/config-sunos5.5-g++.h
+++ b/ace/config-sunos5.5-g++.h
@@ -11,6 +11,9 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_BROKEN_EXPLICIT_TEMPLATE_DESTRUCTOR
#define ACE_HAS_STRING_CLASS
diff --git a/ace/config-sunos5.5-sunc++-4.x.h b/ace/config-sunos5.5-sunc++-4.x.h
index 58085c05d9a..d3c27d8eebf 100644
--- a/ace/config-sunos5.5-sunc++-4.x.h
+++ b/ace/config-sunos5.5-sunc++-4.x.h
@@ -26,6 +26,9 @@
# define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// ACE_HAS_EXCEPTIONS precludes -noex in
// include/makeinclude/platform_macros.GNU. But beware, we have
// seen problems with exception handling on multiprocessor
diff --git a/ace/config-sunx86-sunc++-4.x.h b/ace/config-sunx86-sunc++-4.x.h
index 74517562e95..3a9cba62c2d 100644
--- a/ace/config-sunx86-sunc++-4.x.h
+++ b/ace/config-sunx86-sunc++-4.x.h
@@ -7,6 +7,9 @@
#if !defined (ACE_CONFIG_H)
#define ACE_CONFIG_H
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Platform supports pread() and pwrite()
#define ACE_HAS_P_READ_WRITE
diff --git a/ace/config-tandem.h b/ace/config-tandem.h
index e8c49de792a..2631d5bb44d 100644
--- a/ace/config-tandem.h
+++ b/ace/config-tandem.h
@@ -22,6 +22,9 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Tandem doesn't include this although they are defined
// in sys/time.h and sys/resource.h
#define ACE_LACKS_RLIMIT_PROTOTYPE // jjpp
diff --git a/ace/config-unixware-2.01-g++.h b/ace/config-unixware-2.01-g++.h
index c5822bc9df3..c2ecc2700c5 100644
--- a/ace/config-unixware-2.01-g++.h
+++ b/ace/config-unixware-2.01-g++.h
@@ -12,6 +12,9 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_STRING_CLASS
#define ACE_LACKS_STRCASECMP
#define ACE_HAS_SIZET_SOCKET_LEN
diff --git a/ace/config-unixware-2.1.2-g++.h b/ace/config-unixware-2.1.2-g++.h
index d32bd96a67e..3900300ae00 100644
--- a/ace/config-unixware-2.1.2-g++.h
+++ b/ace/config-unixware-2.1.2-g++.h
@@ -10,6 +10,9 @@
#define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_NEEDS_SYSTIME_H
#define ACE_HAS_UALARM
#define ACE_HAS_SIZET_SOCKET_LEN
diff --git a/ace/config-vxworks-ghs-1.8.h b/ace/config-vxworks-ghs-1.8.h
index 3c52aaec238..50c7f44e936 100644
--- a/ace/config-vxworks-ghs-1.8.h
+++ b/ace/config-vxworks-ghs-1.8.h
@@ -16,6 +16,9 @@
# define __ACE_INLINE__
#endif /* ! __ACE_INLINE__ */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_BROKEN_SENDMSG
#define ACE_HAS_BROKEN_WRITEV
#define ACE_HAS_CHARPTR_SOCKOPT
diff --git a/ace/config-vxworks5.x-g++.h b/ace/config-vxworks5.x-g++.h
index 3d7087ad4d7..9d86a7199d5 100644
--- a/ace/config-vxworks5.x-g++.h
+++ b/ace/config-vxworks5.x-g++.h
@@ -36,6 +36,9 @@
// include iostream.h only where they need it.
#define ACE_HAS_MINIMUM_IOSTREAMH_INCLUSION
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
#define ACE_HAS_MSG
#define ACE_HAS_MT_SAFE_SOCKETS
#define ACE_HAS_NONSTATIC_OBJECT_MANAGER
diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h
index 124cfbd8c48..31b86053950 100644
--- a/ace/config-win32-common.h
+++ b/ace/config-win32-common.h
@@ -30,6 +30,9 @@
#define ACE_HAS_TYPENAME_KEYWORD
#endif /* _MSC_VER >= 1100 */
+// Optimize ACE_Handle_Set for select().
+#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT
+
// Win32 has UNICODE support
#define ACE_HAS_UNICODE