diff options
29 files changed, 471 insertions, 53 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index d9ae0d708d4..a456477d6dc 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,3 +1,16 @@ +Tue Apr 22 00:21:03 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * examples/OS/Process/process.cpp (main): Replaced the use of + "/bin/cat" with "cat" since we are now using execvp(). Thanks + to Nanbor Wang <nw1@cs.wustl.edu> for reporting this. + + * ace/Process.cpp (start): Changed the use of execv() to execvp() + in order to avoid having to pass in the full pathname. + + * ace/OS.i (sigwait): Added an #ifdef for FreeBSD so that we + return ACE_NOTSUP_RETURN(-1) for ACE_OS::sigwait(). Thanks to + Nanbor Wang <nw1@cs.wustl.edu> for reporting this. + Mon Apr 21 18:14:32 1997 Irfan Pyarali <irfan@flamenco.cs.wustl.edu> * ace/config-win32-common.h: Added checks around _AFXDLL before @@ -29,6 +42,16 @@ Sun Apr 20 20:47:34 1997 Sumedh Mungee <sumedh@cs.wustl.edu> * apps/JAWS/stress-testing: Added README file +Sun Apr 20 13:11:25 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * apps/Makefile: By default, we now compile JAWS along with the + rest of ACE. I've also added some README files that explain + what JAWS is all about. + + * examples/Service_Configurator/Misc/Timer_Service: Improved the + Timer_Service test so that it makes more sense and is better + documented. + Sat Apr 19 11:56:35 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * include/makeinclude: Removed the platform_irix6.2_sgiCC.GNU diff --git a/ace/IPC_SAP.h b/ace/IPC_SAP.h index ee7a4ede41c..4b6849d22ff 100644 --- a/ace/IPC_SAP.h +++ b/ace/IPC_SAP.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY @@ -1335,6 +1335,9 @@ typedef int ACE_thread_key_t; // This must come after signal.h is #included. #if defined (SCO) #define SIGIO SIGPOLL +#endif + +#if defined (SCO) || defined (FreeBSD) #undef sigemptyset #undef sigfillset #undef sigaddset @@ -3909,7 +3909,9 @@ ACE_OS::sigwait (sigset_t *set, int *sig) if (sig == 0) sig = &local_sig; #if defined (ACE_HAS_THREADS) -#if defined (ACE_HAS_STHREADS) || defined (ACE_HAS_FSU_PTHREADS) +#if defined (FreeBSD) + ACE_NOTSUP_RETURN (-1); +#elif defined (ACE_HAS_STHREADS) || defined (ACE_HAS_FSU_PTHREADS) *sig = ::sigwait (set); return *sig; #elif defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) @@ -3932,7 +3934,7 @@ ACE_OS::sigwait (sigset_t *set, int *sig) // third arg is timeout: 0 means forever *sig = ::sigtimedwait (set, 0, 0); return *sig; -#endif /* ACE_HAS_STHREADS */ +#endif /* FreeBSD */ #else ACE_UNUSED_ARG (set); ACE_UNUSED_ARG (sig); diff --git a/ace/Process.cpp b/ace/Process.cpp index 071d8eabcbb..c2290ea1d6c 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -184,7 +184,7 @@ ACE_Process::start (char *argv[], char *envp[]) int result; if (envp == 0) - result = ACE_OS::execv (argv[0], argv); + result = ACE_OS::execvp (argv[0], argv); else result = ACE_OS::execve (argv[0], argv, envp); diff --git a/ace/Process.h b/ace/Process.h index ac2313ae63b..efb163be722 100644 --- a/ace/Process.h +++ b/ace/Process.h @@ -45,7 +45,8 @@ public: ACE_HANDLE std_err = ACE_INVALID_HANDLE, char *envp[] = 0); // Set the standard handles of the new process to the respective - // handles and start the new process. If <argv> is non-NULL it + // handles and start the new process (using <execvp>/<execve> on + // UNIX and <CreateProcess> on Win32>). If <argv> is non-NULL it // should be of the following form: argv = { // "c:\full\path\to\foo.exe", "-a", "arg1", "etc", 0 }. If <argv> // is NULL then no <exec> is performed. If <argv> is non-NULL and @@ -69,12 +70,14 @@ public: // Set the working directory for the process. pid_t start (char *argv[], char *envp[] = 0); - // Start the new process. If <argv> is non-NULL it should be of the - // following form: argv = { "c:\full\path\to\foo.exe", "-a", "arg1", - // "etc", 0 }. If <argv> is NULL then no <exec> is performed. If - // <argv> is non-NULL and <envp> is specified, it is passed as the - // environment for the new process, according to the rules for - // execve(). Returns the new process id on success, -1 on failure. + // Start the new process (using <execvp>/<execve> on UNIX and + // <CreateProcess> on Win32>). If <argv> is non-NULL it should be + // of the following form: argv = { "c:\full\path\to\foo.exe", "-a", + // "arg1", "etc", 0 }. If <argv> is NULL then no <exec> is + // performed. If <argv> is non-NULL and <envp> is specified, it is + // passed as the environment for the new process, according to the + // rules for execve(). Returns the new process id on success, -1 on + // failure. int wait (void); // Wait for the process we just created to exit. diff --git a/ace/README b/ace/README index 4e9b7aed9dd..ea044cceb2b 100644 --- a/ace/README +++ b/ace/README @@ -15,6 +15,7 @@ autoconf or Larry Wall's metaconfig... Macro Description ----- ----------- +ACE_HAS_4_4BSD_SENDMSG_RECVMSG Platform has BSD 4.4 sendmsg()/recvmsg() APIs. ACE_HAS_P_READ_WRITE Platform has pread() and pwrite() support ACE_HAS_64BIT_LONGS Platform has 64bit longs and 32bit ints... ACE_HAS_AIX_BROKEN_SOCKET_HEADER Platform, such as AIX4, needs to wrap #include of sys/socket.h with #undef/#define of __cplusplus. diff --git a/ace/SPIPE.h b/ace/SPIPE.h index 755d3bfa9e2..f99d211816d 100644 --- a/ace/SPIPE.h +++ b/ace/SPIPE.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/SPIPE_Acceptor.h b/ace/SPIPE_Acceptor.h index 3863625d489..96efc060c65 100644 --- a/ace/SPIPE_Acceptor.h +++ b/ace/SPIPE_Acceptor.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/SPIPE_Stream.h b/ace/SPIPE_Stream.h index 3da98013637..96a3cd2a02f 100644 --- a/ace/SPIPE_Stream.h +++ b/ace/SPIPE_Stream.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/config-freebsd-pthread.h b/ace/config-freebsd-pthread.h new file mode 100644 index 00000000000..1239f89e8ed --- /dev/null +++ b/ace/config-freebsd-pthread.h @@ -0,0 +1,128 @@ +/* -*- C++ -*- */ +// config-freebsd-pthread.h + +// ***** This configuration file is still under debugging. ***** +// ***** It still doesn't work quite the way it expected to. ***** + +// The following configuration file is designed to work for FreeBSD +// platforms using GNU C++ and the POSIX (pthread) threads package +// by John Birrell. You must at least have 3.0-current as of 2/9/1997 to +// take the advantage of latest pthread library. + +#if !defined (ACE_CONFIG_H) +#define ACE_CONFIG_H + +// Platform specific directives +#define FreeBSD +#define _THREAD_SAFE + +// Platform supports POSIX timers via timestruct_t. +#define ACE_HAS_POSIX_TIME +#define ACE_NEEDS_SYSTIME_H + +#define ACE_LACKS_STRRECVFD + +#define ACE_HAS_SIN_LEN + +// Platform supports System V IPC (most versions of UNIX, but not Win32) +#define ACE_HAS_SYSV_IPC + +// Compiler/platform contains the <sys/syscall.h> file. +#define ACE_HAS_SYSCALL_H + +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Compiler/platform supports SVR4 signal typedef +#define ACE_HAS_SVR4_SIGNAL_T + +// Compiler/platform supports alloca(). +#define ACE_HAS_ALLOCA + +// Compiler/platform supports SVR4 dynamic linking semantics.. +#define ACE_HAS_SVR4_DYNAMIC_LINKING + +// Compiler/platform correctly calls init()/fini() for shared libraries. +#define ACE_HAS_AUTOMATIC_INIT_FINI + +// Explicit dynamic linking permits "lazy" symbol resolution +#define ACE_HAS_RTLD_LAZY_V + +// platform supports POSIX O_NONBLOCK semantics +#define ACE_HAS_POSIX_NONBLOCK + +// platform supports IP multicast +#define ACE_HAS_IP_MULTICAST + +// ***** NOT SURE YET ***** However, this doesn't seem to be +// used any where, so I just put it in. ;0 +// Sockets may be called in multi-threaded programs. +#define ACE_HAS_MT_SAFE_SOCKETS + +// Compiler/platform has <alloca.h> +//#define ACE_HAS_ALLOCA_H + +// Compiler/platform has the getrusage() system call. +#define ACE_HAS_GETRUSAGE + +// Compiler/platform defines the sig_atomic_t typedef. +#define ACE_HAS_SIG_ATOMIC_T + +// Compiler/platform supports sys_siglist array. +// *** This refers to (_sys_siglist) instead of (sys_siglist) +// #define ACE_HAS_SYS_SIGLIST + +// Compiler/platform defines a union semun for SysV shared memory. +#define ACE_HAS_SEMUN + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// Compiler/platform provides the sockio.h file. +#define ACE_HAS_SOCKIO_H + +// Defines the page size of the system. +#define ACE_PAGE_SIZE 4096 + +// Platform provides <sys/filio.h> header. +#define ACE_HAS_SYS_FILIO_H + +// Compiler/platform supports SVR4 gettimeofday() prototype +#define ACE_HAS_SUNOS4_GETTIMEOFDAY +// #define ACE_HAS_TIMEZONE_GETTIMEOFDAY + +// Turns off the tracing feature. +#if !defined (ACE_NTRACE) +#define ACE_NTRACE 1 +#endif /* ACE_NTRACE */ + +#define ACE_HAS_MSG +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG + +// TDN - adapted from file for SunOS4 platforms using the GNU g++ compiler +// Compiler's template mechanism must see source code (i.e., .C files). +#define ACE_TEMPLATES_REQUIRE_SOURCE + +#define ACE_TEMPLATES_REQUIRE_SPECIALIZATION + +// Compiler doesn't support static data member templates. +#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES + +// Thread specific settings +// Yes, we do have threads. +#define ACE_HAS_THREADS +// And they're even POSIX pthreads +#define ACE_MT_SAFE +#define ACE_HAS_PTHREADS +#define ACE_LACKS_SETSCHED +#define ACE_LACKS_THREAD_PROCESS_SCOPING +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_LACKS_CONDATTR_PSHARED +// this one is in doubt +#define ACE_HAS_THREAD_SPECIFIC_STORAGE + +// #define ACE_HAS_SIGWAIT + +#endif /* ACE_CONFIG_H */ diff --git a/ace/config-freebsd.h b/ace/config-freebsd.h new file mode 100644 index 00000000000..b439e0a106c --- /dev/null +++ b/ace/config-freebsd.h @@ -0,0 +1,111 @@ +/* -*- C++ -*- */ +// config-freebsd.h + +// ***** This configuration file is still under testing. ***** + +// The following configuration file is designed to work for FreeBSD +// platforms using GNU C++ but without the POSIX (pthread) threads package + +#if !defined (ACE_CONFIG_H) +#define ACE_CONFIG_H + +// Platform specific directives +#define FreeBSD + +// Platform supports POSIX timers via timestruct_t. +#define ACE_HAS_POSIX_TIME +#define ACE_NEEDS_SYSTIME_H + +#define ACE_LACKS_STRRECVFD + +#define ACE_HAS_SIN_LEN + +// Platform supports System V IPC (most versions of UNIX, but not Win32) +#define ACE_HAS_SYSV_IPC + +// Compiler/platform contains the <sys/syscall.h> file. +#define ACE_HAS_SYSCALL_H + +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Compiler/platform supports SVR4 signal typedef +#define ACE_HAS_SVR4_SIGNAL_T + +// Compiler/platform supports alloca(). +#define ACE_HAS_ALLOCA + +// Compiler/platform supports SVR4 dynamic linking semantics.. +#define ACE_HAS_SVR4_DYNAMIC_LINKING + +// Compiler/platform correctly calls init()/fini() for shared libraries. +#define ACE_HAS_AUTOMATIC_INIT_FINI + +// Explicit dynamic linking permits "lazy" symbol resolution +#define ACE_HAS_RTLD_LAZY_V + +// platform supports POSIX O_NONBLOCK semantics +#define ACE_HAS_POSIX_NONBLOCK + +// platform supports IP multicast +#define ACE_HAS_IP_MULTICAST + +// ***** NOT SURE YET ***** However, this doesn't seem to be +// used any where, so I just put it in. ;0 +// Sockets may be called in multi-threaded programs. +#define ACE_HAS_MT_SAFE_SOCKETS + +// Compiler/platform has <alloca.h> +//#define ACE_HAS_ALLOCA_H + +// Compiler/platform has the getrusage() system call. +#define ACE_HAS_GETRUSAGE + +// Compiler/platform defines the sig_atomic_t typedef. +#define ACE_HAS_SIG_ATOMIC_T + +// Compiler/platform supports sys_siglist array. +// *** This refers to (_sys_siglist) instead of (sys_siglist) +// #define ACE_HAS_SYS_SIGLIST + +// Compiler/platform defines a union semun for SysV shared memory. +#define ACE_HAS_SEMUN + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// Compiler/platform provides the sockio.h file. +#define ACE_HAS_SOCKIO_H + +// Defines the page size of the system. +#define ACE_PAGE_SIZE 4096 + +// Platform provides <sys/filio.h> header. +#define ACE_HAS_SYS_FILIO_H + +// Compiler/platform supports SVR4 gettimeofday() prototype +#define ACE_HAS_SUNOS4_GETTIMEOFDAY +// #define ACE_HAS_TIMEZONE_GETTIMEOFDAY + +// Turns off the tracing feature. +#if !defined (ACE_NTRACE) +#define ACE_NTRACE 1 +#endif /* ACE_NTRACE */ + +#define ACE_HAS_MSG +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG + +// TDN - adapted from file for SunOS4 platforms using the GNU g++ compiler +// Compiler's template mechanism must see source code (i.e., .C files). +#define ACE_TEMPLATES_REQUIRE_SOURCE + +#define ACE_TEMPLATES_REQUIRE_SPECIALIZATION + +// Compiler doesn't support static data member templates. +#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES + +// #define ACE_HAS_SIGWAIT + +#endif /* ACE_CONFIG_H */ diff --git a/apps/JAWS/Makefile b/apps/JAWS/Makefile index 597ac5d1d52..44fd29fbae2 100644 --- a/apps/JAWS/Makefile +++ b/apps/JAWS/Makefile @@ -14,8 +14,6 @@ DIRS = server \ client \ stress_testing - - #---------------------------------------------------------------------------- # Include macros and targets #---------------------------------------------------------------------------- diff --git a/apps/JAWS/README b/apps/JAWS/README new file mode 100644 index 00000000000..687b10690a2 --- /dev/null +++ b/apps/JAWS/README @@ -0,0 +1,19 @@ +This directory contains the source code and test examples for JAWS, +which is a high-performance HTTP Web server written with ACE. For +more information on JAWS, please see + +http://www.cs.wustl.edu/~jxh/research/ + +The subdirectories in this directory contain the following components + + . client -- This contains the source code for an example + application that exercises the file uploading and downloading + features of JAWS + + . server -- This contains the source code for the JAWS + HTTP Web server. It illustrates a number of sophisticated + ACE concurrency and event demultiplexing strategies. + + . stress-testing -- This is the http_tester suite, an ACE + based HTTP benchmarking tool, used to evaluate the + performance of JAWS and other HTTP servers. diff --git a/apps/JAWS/server/README b/apps/JAWS/server/README index 89913e7f4d8..6b5b6a2258d 100644 --- a/apps/JAWS/server/README +++ b/apps/JAWS/server/README @@ -1,27 +1,20 @@ README for the JAWS server -------------------------- - This is the README file for the JAWS server. - Compiling --------- JAWS is an ACE application, and it can be compiled using the Makefile, or jaws.mdp file, as any other ACE application. - - Running ------- - To run JAWS, simply execute "main". It supports the following command-line arguments. - - -p port Start JAWS on the specified port -n num_threads Use num_threads as the maximum number of threads -s strategy Use one of following strategies: diff --git a/apps/JAWS/stress_testing/README b/apps/JAWS/stress_testing/README index f357daed4c7..0969522d638 100644 --- a/apps/JAWS/stress_testing/README +++ b/apps/JAWS/stress_testing/README @@ -2,7 +2,7 @@ http_tester ----------- This is the http_tester suite, an ACE based HTTP benchmarking tool, -used to evaluate the performance of JAWS. +used to evaluate the performance of JAWS and other HTTP servers. Usage ----- diff --git a/apps/Makefile b/apps/Makefile index 3883598f646..8110e3ea035 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -10,12 +10,14 @@ INFO = README -DIRS = Gateway +DIRS = Gateway \ + JAWS -# The following directory isn't compiled by default since haven't +# The following directories aren't compiled by default since haven't # finished integrating it into ACE... # -# Orbix-Examples +# Orbix-Examples +# gperf #---------------------------------------------------------------------------- # Include macros and targets diff --git a/apps/README b/apps/README index 348bf472216..758b6c0b68d 100644 --- a/apps/README +++ b/apps/README @@ -5,15 +5,13 @@ applications that utilize the ACE features. gateway that uses source-based and destination-based routing of messages between peers connected via TCP/IP networks. + . JAWS -- This is a high-performance HTTP Web server written + with ACE. It illustrates a number of sophisticated ACE + concurrency and event demultiplexing strategies. + . Orbix-Examples -- Implements several applications that integrate ACE and Orbix (which is IONA's implementation of - CORBA). - - . Synch-Benchmarks -- Implements a number of benchmarks - that test the performance of various synchronization - mechanisms. - - . TTCP -- Implements several variants of the TTCP benchmarking - test for TCP and UCP using C sockets, ACE C++ wrappers, and - several versions of CORBA (Orbix and ORBeline). + CORBA). By default, these aren't compiled since most + platforms don't have Orbix. + . gperf -- The GNU perfect hash function generator. diff --git a/apps/gperf/README b/apps/gperf/README index bd9d14ea680..956db3e570f 100644 --- a/apps/gperf/README +++ b/apps/gperf/README @@ -19,6 +19,10 @@ Output from the GPERF program is used to recognize reserved words in the GNU C, GNU C++, and GNU Pascal compilers, as well as with the GNU indent program. +For more information on GPERF, please see + +http://www.cs.wustl.edu/~schmidt/C++-USENIX-90.ps.gz + Happy hacking! Douglas C. Schmidt diff --git a/examples/IPC_SAP/SPIPE_SAP/server.cpp b/examples/IPC_SAP/SPIPE_SAP/server.cpp index b35d427b97d..574e96e2975 100644 --- a/examples/IPC_SAP/SPIPE_SAP/server.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/server.cpp @@ -1,6 +1,6 @@ -#include "ace/SPIPE_Addr.h" // $Id$ +#include "ace/SPIPE_Addr.h" #include "ace/SPIPE_Acceptor.h" #include "shared.h" diff --git a/examples/OS/Process/process.cpp b/examples/OS/Process/process.cpp index 7003f349d02..377e4080f23 100644 --- a/examples/OS/Process/process.cpp +++ b/examples/OS/Process/process.cpp @@ -24,7 +24,7 @@ #if defined (ACE_WIN32) #define EXEC_NAME "c:\\WINNT35\\system32\\MORE.COM" #else -#define EXEC_NAME "/usr/bin/cat"; +#define EXEC_NAME "cat"; #endif /* ACE_WIN32 */ int @@ -33,8 +33,8 @@ main (int argc, char *argv[]) if (ACE_LOG_MSG->open (argv[0]) == -1) ACE_ERROR ((LM_ERROR, "cannot open logger!!!\n")); - char *executable = argc > 1 ? argv[1] : EXEC_NAME; - char *input_file = argc > 2 ? argv[2] : "process.cpp"; + const char *executable = argc > 1 ? argv[1] : EXEC_NAME; + const char *input_file = argc > 2 ? argv[2] : "process.cpp"; ACE_HANDLE infile = ACE_OS::open (input_file, O_RDONLY); diff --git a/examples/Service_Configurator/Misc/Timer_Service.cpp b/examples/Service_Configurator/Misc/Timer_Service.cpp index 8852df4b78c..59c271e3eab 100644 --- a/examples/Service_Configurator/Misc/Timer_Service.cpp +++ b/examples/Service_Configurator/Misc/Timer_Service.cpp @@ -1,23 +1,53 @@ -#include "Timer_Service.h" // $Id$ +#include "Timer_Service.h" + int Timer_Service::init (int argc, char *argv[]) { - int interval = argc > 1 ? ACE_OS::atoi (argv[1]) : 4; + ACE_DEBUG ((LM_DEBUG, + "in Timer_Service::init, argv[0] = %s, argc == %d\n", + argv[0], argc)); + + for (size_t i = 0; i < argc; i++) + ACE_DEBUG ((LM_DEBUG, "argv[%d] = %s\n", i, argv[i])); + + int interval; + + if (argc > 1) + { + // If the second argument exists use this as the interval for + // the periodic timer. Otherwise, go off every TIMEOUT seconds. + + interval = ACE_OS::atoi (argv[1]); + + if (interval == 0) + interval = Timer_Service::TIMEOUT; + } if (argc > 2) + { + // If the third argument exists use it to control the maximum + // number of timeouts. + this->max_timeouts_ = ACE_OS::atoi (argv[2]); + + if (this->max_timeouts_ == 0) + this->max_timeouts_ = Timer_Service::MAX_TIMEOUTS; + } + + this->cur_timeouts_ = 0; + + // If the fourth argument exists take this as an indication to + // enable tracing. + if (argc > 3) ACE_Trace::start_tracing (); else ACE_Trace::stop_tracing (); - ACE_DEBUG ((LM_DEBUG, - "in Timer_Service::init, argv[0] = %s, argc == %d\n", - argv[0], argc)); - - ACE_Service_Config::reactor ()->schedule_timer + // Register the timer to go off in 1 second, and then to go off + // every <interval> seconds. + return ACE_Service_Config::reactor ()->schedule_timer (this, 0, ACE_Time_Value (1), ACE_Time_Value (interval)); - return 0; } int @@ -25,8 +55,27 @@ Timer_Service::handle_timeout (const ACE_Time_Value &tv, const void *) { ACE_DEBUG ((LM_DEBUG, - "in Timer_Service::handle_timeout sec = %d, usec = %d\n", - tv.sec (), tv.usec ())); + "in Timer_Service::handle_timeout sec = %d, usec = %d" + " cur_timeouts = %d, max_timeouts = %d\n", + tv.sec (), tv.usec (), + this->cur_timeouts_, this->max_timeouts_)); + + this->cur_timeouts_++; + + if (this->cur_timeouts_ == this->max_timeouts_) + // Shutdown the test. + return -1; + else + return 0; +} + +int +Timer_Service::handle_close (ACE_HANDLE, + ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "closing down the timer test\n")); + + ACE_Service_Config::end_reactor_event_loop (); return 0; } diff --git a/examples/Service_Configurator/Misc/Timer_Service.h b/examples/Service_Configurator/Misc/Timer_Service.h index 506b4634a71..2166dbbe22e 100644 --- a/examples/Service_Configurator/Misc/Timer_Service.h +++ b/examples/Service_Configurator/Misc/Timer_Service.h @@ -7,9 +7,27 @@ class Timer_Service : public ACE_Service_Object { public: virtual int init (int argc, char *argv[]); + // Initialization hook. virtual int handle_timeout (const ACE_Time_Value &, const void *); + // Timeout hook. + + virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); + // Close hook. + +private: + enum + { + TIMEOUT = 4, // Wait 4 seconds between timeouts + MAX_TIMEOUTS = 10 // Don't timeout for more than 10 times. + }; + + int max_timeouts_; + // Maximum number of timeouts before shutting down the test. + + int cur_timeouts_; + // Current number of timeouts. }; ACE_STATIC_SVC_DECLARE (Timer_Service) diff --git a/examples/Service_Configurator/Misc/main.cpp b/examples/Service_Configurator/Misc/main.cpp index 03957234a35..29f1e260517 100644 --- a/examples/Service_Configurator/Misc/main.cpp +++ b/examples/Service_Configurator/Misc/main.cpp @@ -1,6 +1,6 @@ -#include "ace/Service_Config.h" // $Id$ +#include "ace/Service_Config.h" #include "Timer_Service.h" // Create an object that will insert the Timer_Service into the list diff --git a/examples/Service_Configurator/Misc/svc.conf b/examples/Service_Configurator/Misc/svc.conf index c3eb2fc6cea..e1a6070ccc8 100644 --- a/examples/Service_Configurator/Misc/svc.conf +++ b/examples/Service_Configurator/Misc/svc.conf @@ -1 +1,6 @@ -static Timer_Service "timer $TIME $TRACE" +# Statically configure the Timer_Service into the application process +# and pass in up to 4 arguments. The final 3 arguments are retrieved from +# environment variables, so they can be set by changing your +# environment before running the main program. If you don't have +# these variables set they are ignored. +static Timer_Service "timer $INTERVAL $MAX_TIMEOUTS $TRACE" diff --git a/include/makeinclude/platform_freebsd.GNU b/include/makeinclude/platform_freebsd.GNU new file mode 100644 index 00000000000..f27ed35025e --- /dev/null +++ b/include/makeinclude/platform_freebsd.GNU @@ -0,0 +1,21 @@ +# platform_freebsd.GNU + +# ***** Notice: This file is still under testing. ***** +# To be used on FreeBSD platform without pthread support. + +CC = gcc -w +CXX = gcc -w -I. -fno-strict-prototypes -D__ACE_INLINE__ +DLD = ld +LD = $(CXX) +LIBS += -lstdc++ -lcompat +PIC = -fpic -DPIC +AR = ar +ARFLAGS = ruv +RANLIB = ranlib + +SOFLAGS = -Bshareable -x +SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $< +PRELIB = (echo "int main() { return 0; }" > gcctemp.c && \ + $(COMPILE.cc) -o gcctemp.o gcctemp.c && \ + $(LINK.cc) -o gcctemp gcctemp.o $^ $(LDFLAGS) $(LIBS); \ + status=$$?; exit $$status) diff --git a/include/makeinclude/platform_freebsd_pthread.GNU b/include/makeinclude/platform_freebsd_pthread.GNU new file mode 100644 index 00000000000..b8b0b4da00e --- /dev/null +++ b/include/makeinclude/platform_freebsd_pthread.GNU @@ -0,0 +1,30 @@ +# platform_freebsd_pthread.GNU + +# ***** Notice: This configuration is still under debugging. ***** +# ***** It still doesn't work quite the way it expected to. ***** + +# For pthreads support on FreeBSD, you need +# -D_POSIX_THREADS +# You must have the latest pthread library by John Birrell. +# and link with reentrant library libc_r. If you can't find this +# library (libc_r.so) in your system, do a "man pthread" and follow the +# instruction to build your own. You must have at least 3.0-current as +# of 2/9/1997 to take advantage of the latest feature of pthread library. + +CC = gcc -w +CXX = gcc -w -I. -fno-strict-prototypes -D__ACE_INLINE__ -D_POSIX_THREADS +DLD = ld +LD = $(CXX) +LIBS += -lc_r -lstdc++ -lcompat +PIC = -fpic -DPIC +AR = ar +ARFLAGS = ruv +RANLIB = ranlib + +# SOFLAGS = $(CPPFLAGS) -shared +SOFLAGS = -Bshareable -x +SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $< +PRELIB = (echo "int main() { return 0; }" > gcctemp.c && \ + $(COMPILE.cc) -o gcctemp.o gcctemp.c && \ + $(LINK.cc) -o gcctemp gcctemp.o $^ $(LDFLAGS) $(LIBS); \ + status=$$?; exit $$status) diff --git a/performance-tests/Misc/test_singleton.cpp b/performance-tests/Misc/test_singleton.cpp index 4aab7492f8c..db19735d9b9 100644 --- a/performance-tests/Misc/test_singleton.cpp +++ b/performance-tests/Misc/test_singleton.cpp @@ -1,6 +1,6 @@ -// This example illustrates the performance impact of using the // $Id$ +// This example illustrates the performance impact of using the // Double-Checked Locking pattern compared with using the "standard" // practice of acquiring and releasing a lock on every instance() // call. In addition, we compare the performance of using the diff --git a/performance-tests/README b/performance-tests/README new file mode 100644 index 00000000000..4be2f1e518b --- /dev/null +++ b/performance-tests/README @@ -0,0 +1,14 @@ +The subdirectories in this directory provide a number of benchmarks +that use ACE features to determine performance of various concurrency +and communication mechanisms. + + . Synch-Benchmarks -- Implements a number of benchmarks + that test the performance of various synchronization + mechanisms. + + . TTCP -- Implements several variants of the TTCP benchmarking + test for TCP and UCP using C sockets, ACE C++ wrappers, and + several versions of CORBA (Orbix and ORBeline). + + . Misc -- Miscellaneous tests, e.g., Double-Checked Locking, + context switching, mutexes, naming, etc. |