diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-30 08:31:33 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-30 08:31:33 +0000 |
commit | b439552b46fa41de8560ad37ab37876faae8b174 (patch) | |
tree | 75ab3863b86184ff03c20f505578e67da491edc0 /performance-tests/Synch-Benchmarks | |
parent | bb9cff7f4b1472bf430e09cfd7f8ff39a225f71a (diff) | |
download | ATCD-b439552b46fa41de8560ad37ab37876faae8b174.tar.gz |
Re-organizing the directory.
Diffstat (limited to 'performance-tests/Synch-Benchmarks')
25 files changed, 0 insertions, 1984 deletions
diff --git a/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.cpp b/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.cpp deleted file mode 100644 index 0c8871a96dd..00000000000 --- a/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Adaptive_Lock_Performance_Test_Base.h" - -ACE_RCSID(Synch_Benchmarks, Adaptive_Lock_Performance_Test_Base_, "$Id$") - -#if defined (ACE_HAS_THREADS) - -ACE_Lock *Adaptive_Lock_Performance_Test_Base::lock_ = 0; - -int -Adaptive_Lock_Performance_Test_Base::fini (void) -{ - delete Adaptive_Lock_Performance_Test_Base::lock_; - Adaptive_Lock_Performance_Test_Base::lock_ = 0; - return 0; -} - -int -Adaptive_Lock_Performance_Test_Base::svc (void) -{ - // Extract out the unique thread-specific value to be used as an - // index... - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - Adaptive_Lock_Performance_Test_Base::lock_->acquire (); - options.thr_work_count[ni]++; - buffer++; - Adaptive_Lock_Performance_Test_Base::lock_->release (); - } - /* NOTREACHED */ - return 0; -} - -int -Adaptive_Lock_Performance_Test_Base::set_lock (ACE_Lock *lock) -{ - delete Adaptive_Lock_Performance_Test_Base::lock_; - Adaptive_Lock_Performance_Test_Base::lock_ = lock; - return (Adaptive_Lock_Performance_Test_Base::lock_ != 0 ? 0 : -1); -} - -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.h b/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.h deleted file mode 100644 index 1845c06d023..00000000000 --- a/performance-tests/Synch-Benchmarks/Adaptive_Lock_Performance_Test_Base.h +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -#if !defined (ACE_ADAPTIVE_LOCK_PERFORMANCE_TEST_BASE_H) -#define ACE_ADAPTIVE_LOCK_PERFORMANCE_TEST_BASE_H -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, Adaptive_Lock_Performance_Test_Base, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Adaptive_Lock_Performance_Test_Base : public Benchmark_Performance -{ -public: - virtual int init (int, char *[]) = 0; - virtual int fini (void); - virtual int svc (void); - - int set_lock (ACE_Lock *lock); - -private: - static ACE_Lock *lock_; -}; -#endif /* ACE_HAS_THREADS */ -#endif /* ACE_ADAPTIVE_LOCK_PERFORMANCE_TEST_BASE_H */ diff --git a/performance-tests/Synch-Benchmarks/Benchmark_Performance.cpp b/performance-tests/Synch-Benchmarks/Benchmark_Performance.cpp deleted file mode 100644 index 34e6b424f06..00000000000 --- a/performance-tests/Synch-Benchmarks/Benchmark_Performance.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, Benchmark_Performance, "$Id$") - -#if defined (ACE_HAS_THREADS) - -// Global variables (used by the dynamically linked services). -ACE_Svc_Export int synch_count; -int buffer; - -// Initialize the static variables. -/* static */ -sig_atomic_t Benchmark_Performance::done_ = 0; - -sig_atomic_t -Benchmark_Performance::done (void) -{ - return Benchmark_Performance::done_; -} - -void -Benchmark_Performance::done (sig_atomic_t d) -{ - Benchmark_Performance::done_ = d; -} - -int -Benchmark_Performance::init (int, char **) -{ - return 1; -} - -int -Benchmark_Performance::info (char **, size_t) const -{ - return -1; -} - -int -Benchmark_Performance::fini (void) -{ - return -1; -} - -void * -Benchmark_Performance::svc_run (Benchmark_Performance *bp) -{ - return (void *) (bp->svc () == -1 ? -1 : 0); -} - -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/Benchmark_Performance.h b/performance-tests/Synch-Benchmarks/Benchmark_Performance.h deleted file mode 100644 index de6491a48b2..00000000000 --- a/performance-tests/Synch-Benchmarks/Benchmark_Performance.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* Defines the class used to dynamically link in the benchmark tests */ - -#if !defined (ACE_BENCHMARK_PERFORMANCE_H) -#define ACE_BENCHMARK_PERFORMANCE_H - -#include "Benchmark_Base.h" - -#if defined (ACE_HAS_THREADS) - -extern int buffer; -extern ACE_Svc_Export int synch_count; - -class ACE_Svc_Export Benchmark_Performance : public Benchmark_Performance_Test_Base -{ - // TITLE - // Base class for all the timing tests. -public: - // = Hooks inherited from ACE_Service_Object. - virtual int svc (void) = 0; - virtual int init (int, char *[]); - virtual int info (char **, size_t) const; - virtual int fini (void); - static void *svc_run (Benchmark_Performance *bp); - - // = Set/get flag that controls how the tests are shut down - // gracefully. - static void done (sig_atomic_t); - static sig_atomic_t done (void); - -protected: - static sig_atomic_t done_; - // Keeps track if we are finished or not. -}; -#endif /* ACE_HAS_THREADS */ -#endif /* ACE_BENCHMARK_PERFORMANCE_H */ diff --git a/performance-tests/Synch-Benchmarks/Performance_Test.cpp b/performance-tests/Synch-Benchmarks/Performance_Test.cpp deleted file mode 100644 index 1172943b0e5..00000000000 --- a/performance-tests/Synch-Benchmarks/Performance_Test.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Service_Repository.h" -#include "ace/Synch.h" - -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" -#include "Performance_Test.h" - -ACE_RCSID(Synch_Benchmarks, Performance_Test, "$Id$") - -Performance_Test::Performance_Test (void) - : n_lwps_ (0), - orig_n_lwps_ (0) -{ -} - -// Initialize and run the benchmarks tests. - -int -Performance_Test::init (int argc, char **argv) -{ - options.parse_args (argc, argv); - return 0; -} - -int -Performance_Test::pre_run_test (Benchmark_Base *bb) -{ - this->orig_n_lwps_ = ACE_Thread::getconcurrency (); - this->n_lwps_ = options.n_lwps (); - Benchmark_Performance *bp = (Benchmark_Performance *) bb; - - if (this->n_lwps_ > 0) - ACE_Thread::setconcurrency (this->n_lwps_); - - // We should probably use a "barrier" here rather than - // THR_SUSPENDED since many OS platforms lack the ability to - // create suspended threads... - if (ACE_Thread_Manager::instance ()->spawn_n - (options.thr_count (), ACE_THR_FUNC (bp->svc_run), - (void *) bp, options.t_flags () | THR_SUSPENDED) == -1) - ACE_ERROR ((LM_ERROR, "%p\n%a", "couldn't spawn threads", 1)); - return 0; -} - -int -Performance_Test::run_test (void) -{ - // Tell the threads that we are not finished. - Benchmark_Performance::done (0); - - // Allow thread(s) to make progress. - ACE_Thread_Manager::instance ()->resume_all (); - - ACE_Time_Value timeout (options.sleep_time ()); - - ACE_DEBUG ((LM_DEBUG, "starting timer\n")); - options.start_timer (); - - // Use Reactor as a timer (which can be interrupted by a signal). - ACE_Reactor::run_event_loop (timeout); - - options.stop_timer (); - ACE_DEBUG ((LM_DEBUG, "\nstopping timer\n")); - - // Stop thread(s) from making any further progress. - ACE_Thread_Manager::instance ()->suspend_all (); - - // Tell the threads that we are finished. - Benchmark_Performance::done (1); - - ACE_DEBUG ((LM_DEBUG, "------------------------------------------------------------------------\n")); - ACE_DEBUG ((LM_DEBUG, "targ 0x%x (%s, %s, %s)\n" - "n_lwps_orig = %d, n_lwps_set = %d, n_lwps_end = %d\n", - options.t_flags (), - (options.t_flags () & THR_DETACHED) ? "THR_DETACHED" : "Not Detached", - (options.t_flags () & THR_BOUND) ? "THR_BOUND" : "Not Bound", - (options.t_flags () & THR_NEW_LWP) ? "THR_NEW_LWP" : "No New_LWP", - this->orig_n_lwps_, this->n_lwps_, ACE_Thread::getconcurrency ())); - - int count = options.count (); - float rate = count / (float (options.sleep_time ())); - - ACE_DEBUG ((LM_DEBUG, - "to count = %d\nrate = %.3f ops/sec, per operation = %.2f usec\n", - count, - rate, - (1.0e6 / rate) / synch_count)); - options.print_results (); - - // Allow thread(s) to finish up. - ACE_Thread_Manager::instance ()->resume_all (); - - // Wait for all the threads to exit. - ACE_Thread_Manager::instance ()->wait (); - options.init (); - return 0; -} - -int -Performance_Test::post_run_test (void) -{ - return 0; -} - -int -Performance_Test::valid_test_object (Benchmark_Base *bb) -{ - return (bb->benchmark_type () == Benchmark_Base::PERFORMANCE); -} - -ACE_SVC_FACTORY_DEFINE (Performance_Test) diff --git a/performance-tests/Synch-Benchmarks/Performance_Test.h b/performance-tests/Synch-Benchmarks/Performance_Test.h deleted file mode 100644 index 9e293ec43d6..00000000000 --- a/performance-tests/Synch-Benchmarks/Performance_Test.h +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#if !defined (ACE_PERFORMANCE_TEST_H) -#define ACE_PERFORMANCE_TEST_H - -#include "Benchmark_Base.h" - -class ACE_Svc_Export Performance_Test : public Benchmark_Method_Base -{ -public: - Performance_Test (void); - int init (int argc, char **argv); - virtual int pre_run_test (Benchmark_Base *bp); - virtual int run_test (void); - virtual int post_run_test (void); - virtual int valid_test_object (Benchmark_Base *); -private: - int n_lwps_; - int orig_n_lwps_; -}; - -ACE_SVC_FACTORY_DECLARE (Performance_Test) - -#endif /* ACE_PERFORMANCE_TEST_H */ diff --git a/performance-tests/Synch-Benchmarks/Performance_Test_Options.cpp b/performance-tests/Synch-Benchmarks/Performance_Test_Options.cpp deleted file mode 100644 index 3d4cc3a7696..00000000000 --- a/performance-tests/Synch-Benchmarks/Performance_Test_Options.cpp +++ /dev/null @@ -1,476 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "Performance_Test_Options.h" - -ACE_RCSID(Synch_Benchmarks, Options, "$Id$") - -#if defined (ACE_HAS_THREADS) -// Manages the options. -Options options; - -size_t -Options::count (void) -{ - size_t total = 0; - - if (options.verbose ()) - ACE_DEBUG ((LM_DEBUG, "Thread work count size = %d\n", options.thr_wc_size)); - - for (int i = 0; i < options.thr_wc_size; i++) - { - if (options.thr_work_count[i] != 0) - { - // if (options.verbose ()) - ACE_DEBUG ((LM_DEBUG, "count[%d] = %d\n", i, options.thr_work_count[i])); - total += options.thr_work_count[i]; - } - } - - return total; -} - -void -Options::init (void) -{ - for (int i = 0; i < this->thr_wc_size; i++) - this->thr_work_count[i] = 0; -} - -Options::Options (void) - : thr_wc_size (10000), - _service_entry (0), - _mapped_file (0), - _pipe_addr (ACE_DEFAULT_RENDEZVOUS), - _sleep_time (100), - _n_lwps (0), - _thr_count (4), - _t_flags (0), - _high_water_mark (8 * 1024), - _low_water_mark (1024), - _msg_size (128), - _initial_queue_length (0), - _logical_connections (1), - _physical_connections (1), - _iterations (100000), - _generate (0), - _udp (0), - _debugging (0), - _verbosity (0), - _ack (1), - _checksum (1), - _xdr (1), - _free_memory (1), - _zero_copy (0), - _print_summary (0), - _consecutive_ports (1), - _eager_exit (0) -{ - this->thr_work_count = new int[this->thr_wc_size]; - this->init (); -} - -void -Options::parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, "a:A:bBc:C:dDe:F:g:H:i:L:l:M:m:n:Np:P:s:S:t:T:uvX:Z:", 0); - int c; - - while ((c = get_opt ()) != -1) - switch (c) - { - case 'a': - this->_ack = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'A': - this->pipe_addr (get_opt.optarg); - break; - case 'B': - this->t_flags (THR_BOUND); - break; - case 'c': - { - long connections = ACE_OS::atoi (get_opt.optarg); - - if (connections < 0) - this->physical_connections (size_t (-connections)); - else if (connections > 0) - this->logical_connections (size_t (connections)); - else - ACE_DEBUG ((LM_WARNING, "warning, 0 connections!\n")); - - break; - } - case 'C': - this->_checksum = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'd': - this->_debugging = 1; - break; - case 'D': - this->t_flags (THR_DETACHED); - break; - case 'e': - this->_eager_exit = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'F': - this->_free_memory = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'g': - this->_generate = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'H': - this->high_water_mark (ACE_OS::atoi (get_opt.optarg)); - break; - case 'i': - this->iterations (ACE_OS::atoi (get_opt.optarg)); - break; - case 'L': - this->low_water_mark (ACE_OS::atoi (get_opt.optarg)); - break; - case 'l': - this->initial_queue_length (ACE_OS::atoi (get_opt.optarg)); - break; - case 'M': - this->msg_size (ACE_OS::atoi (get_opt.optarg)); - break; - case 'm': - this->mapped_file (get_opt.optarg); - break; - case 'N': - this->t_flags (THR_NEW_LWP); - break; - case 'n': - this->n_lwps (ACE_OS::atoi (get_opt.optarg)); - break; - case 'p': - this->_print_summary = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'P': - this->consecutive_ports (ACE_OS::atoi (get_opt.optarg)); - break; - case 'S': - this->service_entry (get_opt.optarg); - break; - case 's': - this->sleep_time (ACE_OS::atoi (get_opt.optarg)); - break; - case 'T': - if (ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0) - ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (get_opt.optarg, "OFF") == 0) - ACE_Trace::stop_tracing (); - break; - case 't': - this->thr_count (ACE_OS::atoi (get_opt.optarg)); - break; - case 'u': - this->_udp = 1; - break; - case 'v': - this->_verbosity = 1; - break; - case 'X': - this->_xdr = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - case 'Z': - this->_zero_copy = ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0; - break; - default: - ACE_DEBUG ((LM_INFO, - "%s\n" - "\t[-a] (send acknowledgement)\n" - "\t[-A] address of pipe [%s]\n" - "\t[-B] (THR_BOUND)\n" - "\t[-c] + number of logical connections\n" - "\t[-c] - number of physical connections\n" - "\t[-C] (enable checksumming)\n" - "\t[-d] (enable debugging)\n" - "\t[-D] (THR_DETACHED)\n" - "\t[-e] (eager exit)\n" - "\t[-F] (free memory)\n" - "\t[-g] (generate data)\n" - "\t[-H] high water mark\n" - "\t[-i] number of test iterations [%d]\n" - "\t[-L] low water mark\n" - "\t[-m] mapped file\n" - "\t[-M] message size\n" - "\t[-n] number of LWPs\n" - "\t[-N] (THR_NEW_LWP)\n" - "\t[-p] (print benchmark summary)\n" - "\t[-P] number of consecutive ports\n" - "\t[-s] sleep time\n" - "\t[-S] service entry\n" - "\t[-t] number of threads [%d]\n" - "\t[-T] (enable tracing)\n" - "\t[-u] (UDP) \n" - "\t[-v] (verbose) \n" - "\t[-X] (enable xdr conversion)\n" - "\t[-Z] (enable zero-copy driver)\n%a", - argv[0], - this->pipe_addr (), - this->iterations (), - this->thr_count (), - 1)); - /* NOTREACHED */ - break; - } - - if (this->do_print_summary ()) - ACE_DEBUG ((LM_INFO, - "%8d = total iterations\n" - "%8d = logical connections\n" - "%8d = physical connections\n" - "%8d = message_size\n" - "%8d = calculated checksum\n" - "%8d = perform xdr conversion\n" - "%8d = number of LWPs requested\n" - "%8d = number of LWPs used\n", - this->iterations (), - this->logical_connections (), - this->physical_connections (), - this->msg_size (), - this->do_checksum () != 0, - this->do_xdr() != 0, - this->n_lwps (), - ACE_Thread::getconcurrency ())); - else if (this->verbose ()) - ACE_DEBUG ((LM_INFO, - "%8d = total iterations\n" - "%8d = logical connections\n" - "%8d = physical connections\n" - "%8d = thread count\n" - "%8d = low water mark\n" - "%8d = high water mark\n" - "%8d = message_size\n" - "%8d = initial queue length\n" - "%8d = consecutive ports\n" - "%8d = calculated checksum\n" - "%8d = perform xdr conversion\n" - "%8d = zero-copy driver\n" - "%8d = free dynamic memory\n" - "%8d = print summary only\n" - "%8d = eager exit\n" - "%8d = UDP\n" - "%8d = send ack\n" - "%8d = THR_DETACHED\n" - "%8d = THR_BOUND\n" - "%8d = THR_NEW_LWP\n" - "%8d = sleep time\n", - this->iterations (), - this->logical_connections (), - this->physical_connections (), - this->thr_count (), - this->low_water_mark (), - this->high_water_mark (), - this->msg_size (), - this->initial_queue_length (), - this->consecutive_ports (), - this->do_checksum () != 0, - this->do_xdr() != 0, - this->do_zero_copy () != 0, - this->do_delete () != 0, - this->do_print_summary () != 0, - this->do_eager_exit () != 0, - this->do_udp () != 0, - this->do_ack () != 0, - (this->t_flags () & THR_DETACHED) != 0, - (this->t_flags () & THR_BOUND) != 0, - (this->t_flags () & THR_NEW_LWP) != 0, - this->sleep_time ())); -} - -void -Options::print_results (void) -{ - ACE_Profile_Timer::ACE_Elapsed_Time et; - this->_itimer.elapsed_time (et); - - ACE_Profile_Timer::Rusage rusage; - this->_itimer.elapsed_rusage (rusage); - - size_t total = this->count (); - double nbytes = total * this->msg_size (); - double cpu_time = et.user_time + et.system_time; - -#if 0 - mutex_timer.print_total ("ACE_Thread_Mutex overhead:", mutex_counter, 2); - condition_timer.print_total ("ACE_Condition overhead:", condition_counter, 2); - ACE_DEBUG ((LM_INFO, - "%8d (number of ACE_Thread_Mutex operations)\n" - "%8d (number of ACE_Condition operations)", - mutex_counter, condition_counter)); -#endif /* NDEBUG */ - - if (this->do_print_summary ()) - { -#if defined (ACE_HAS_PRUSAGE_T) - ACE_DEBUG ((LM_INFO, - "\n%8d PEs\n" - "%8.2f Mbit/sec\n" - "%8d (voluntary context switches)\n" - "%8d (involuntary context switches)\n" - "%8d (total context switches)\n" - "%8d.%d sec (wait-cpu time)\n" - "%8d.%d sec (user lock wait sleep time)\n" - "%8d.%d sec (all other sleep time)\n" - "%8d (major page faults)\n" - "%8d (minor page faults)\n" - "%8d (number of LWPs)\n", - this->thr_count (), - (nbytes / et.real_time) * 8.0 / 1024.0 / 1024.0, - rusage.pr_vctx, - rusage.pr_ictx, - rusage.pr_vctx + rusage.pr_ictx, - rusage.pr_wtime.tv_sec, rusage.pr_wtime.tv_nsec / 1000000, - rusage.pr_ltime.tv_sec, rusage.pr_ltime.tv_nsec / 1000000, - rusage.pr_slptime.tv_sec, rusage.pr_slptime.tv_nsec / 1000000, - rusage.pr_majf, - rusage.pr_minf, - ACE_Thread::getconcurrency ())); -#elif defined (ACE_HAS_GETRUSAGE) && !defined (ACE_WIN32) - ACE_DEBUG ((LM_INFO, - "\n%8d PEs\n" - "%8.2f Mbit/sec\n" - "%8d (voluntary context switches)\n" - "%8d (involuntary context switches)\n" - "%8d (total context switches)\n" - "%8d.%d sec (user time)\n" - "%8d.%d sec (system time)\n" - "%8d (major page faults)\n" - "%8d (minor page faults)\n" - "%8d (number of LWPs)\n", - this->thr_count (), - (nbytes / et.real_time) * 8.0 / 1024.0 / 1024.0, - rusage.ru_nvcsw, - rusage.ru_nivcsw, - rusage.ru_nvcsw + rusage.ru_nivcsw, - rusage.ru_utime.tv_sec, rusage.ru_utime.tv_usec / 1000000, - rusage.ru_stime.tv_sec, rusage.ru_stime.tv_usec / 1000000, - rusage.ru_majflt, - rusage.ru_minflt, - ACE_Thread::getconcurrency ())); -#elif defined (ACE_HAS_GETRUSAGE) && defined (ACE_WIN32) - // Need more stuff for Win32. - ACE_DEBUG ((LM_INFO, - "\n%8d PEs\n" - "%8.2f Mbit/sec\n" - "%8d (number of LWPs)\n", - this->thr_count (), - (nbytes / et.real_time) * 8.0 / 1024.0 / 1024.0, - ACE_Thread::getconcurrency ())); -#endif /* ACE_HAS_PRUSAGE_T */ - } - else - { - ACE_DEBUG ((LM_INFO, - "\ntotal work = %d\n" - "(Only interpret the next two statistics for throughput tests)\n" - "%f bytes in %.2f real seconds = %.2f Mbit/sec\n" - "%f bytes in %.2f CPU seconds = %.2f Mbit/sec\n", - total, - nbytes, et.real_time, (nbytes / et.real_time) * 8.0 / 1024.0 / 1024.0, - nbytes, cpu_time, (nbytes / cpu_time) * 8.0 / 1024.0 / 1024.0)); - -#if defined (ACE_HAS_PRUSAGE_T) - ACE_DEBUG ((LM_INFO, - "%8d = lwpid\n" - "%8d = lwp count\n" - "%8d = minor page faults\n" - "%8d = major page faults\n" - "%8d = input blocks\n" - "%8d = output blocks\n" - "%8d = messages sent\n" - "%8d = messages received\n" - "%8d = signals received\n" - "%8ds, %dms = wait-cpu (latency) time\n" - "%8ds, %dms = user lock wait sleep time\n" - "%8ds, %dms = all other sleep time\n" - "%8d = voluntary context switches\n" - "%8d = involuntary context switches\n" - "%8d = total context switches\n" - "%8d = system calls\n" - "%8d = chars read/written\n" - "%8d = number of LWPs\n" - "---------------------\n" - "real time = %.3f\n" - "user time = %.3f\n" - "system time = %.3f\n" - "---------------------\n", - rusage.pr_lwpid, - rusage.pr_count, - rusage.pr_minf, - rusage.pr_majf, - rusage.pr_inblk, - rusage.pr_oublk, - rusage.pr_msnd, - rusage.pr_mrcv, - rusage.pr_sigs, - rusage.pr_wtime.tv_sec, rusage.pr_wtime.tv_nsec / 1000000, - rusage.pr_ltime.tv_sec, rusage.pr_ltime.tv_nsec / 1000000, - rusage.pr_slptime.tv_sec, rusage.pr_slptime.tv_nsec / 1000000, - rusage.pr_vctx, - rusage.pr_ictx, - rusage.pr_vctx + rusage.pr_ictx, - rusage.pr_sysc, - rusage.pr_ioch, - ACE_Thread::getconcurrency (), - et.real_time, et.user_time, et.system_time)); -#elif defined (ACE_HAS_GETRUSAGE) && !defined (ACE_WIN32) - ACE_DEBUG ((LM_INFO, - "%8d = minor page faults\n" - "%8d = major page faults\n" - "%8d = input blocks\n" - "%8d = output blocks\n" - "%8d = messages sent\n" - "%8d = messages received\n" - "%8d = signals received\n" - "%8d = voluntary context switches\n" - "%8d = involuntary context switches\n" - "%8d = total context switches\n" - "%8d = number of LWPs\n" - "---------------------\n" - "real time = %.3f\n" - "user time = %.3f\n" - "system time = %.3f\n" - "---------------------\n", - rusage.ru_minflt, - rusage.ru_majflt, - rusage.ru_inblock, - rusage.ru_oublock, - rusage.ru_msgsnd, - rusage.ru_msgrcv, - rusage.ru_nsignals, - rusage.ru_nvcsw, - rusage.ru_nivcsw, - rusage.ru_nvcsw + rusage.ru_nivcsw, - ACE_Thread::getconcurrency (), - et.real_time, et.user_time, et.system_time)); -#elif defined (ACE_HAS_GETRUSAGE) && defined (ACE_WIN32) - // need to write more dump ops for rusage on Win32 - ACE_DEBUG ((LM_INFO, - "%8d = number of LWPs\n" - "---------------------\n" - "real time = %.3f\n" - "user time = %.3f\n" - "system time = %.3f\n" - "---------------------\n", - ACE_Thread::getconcurrency (), - et.real_time, et.user_time, et.system_time)); -#endif /* ACE_HAS_PRUSAGE_T */ - } - if (options.do_eager_exit ()) - ACE_OS::_exit (0); -} -#endif /* ACE_HAS_THREADS */ - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -template class ACE_Atomic_Op<ACE_Thread_Mutex, size_t>; -#endif /* ACE_MT_SAFE */ -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -#pragma instantiate ACE_Atomic_Op<ACE_Thread_Mutex, size_t> -#endif /* ACE_MT_SAFE */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/performance-tests/Synch-Benchmarks/Performance_Test_Options.h b/performance-tests/Synch-Benchmarks/Performance_Test_Options.h deleted file mode 100644 index a805db18fd4..00000000000 --- a/performance-tests/Synch-Benchmarks/Performance_Test_Options.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Option manager for performance tests. - -#if !defined (_OPTIONS_H) -#define _OPTIONS_H - -#include "ace/OS.h" -#include "ace/Profile_Timer.h" -#include "ace/Log_Msg.h" -#include "ace/Thread_Manager.h" - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Options -{ -public: - Options (void); - void parse_args (int argc, char *argv[]); - - void init (void); - - void start_timer (void); - void stop_timer (void); - - void thr_count (size_t count); - size_t thr_count (void); - - void pipe_addr (char pipe[]); - char *pipe_addr (void); - - void mapped_file (char filename[]); - char *mapped_file (void); - - void service_entry (char *service_entry); - char *service_entry (void); - - void sleep_time (size_t count); - size_t sleep_time (void); - - void logical_connections (size_t count); - size_t logical_connections (void); - - void physical_connections (size_t count); - size_t physical_connections (void); - - void consecutive_ports (size_t count); - size_t consecutive_ports (void); - - void initial_queue_length (size_t length); - size_t initial_queue_length (void); - - void high_water_mark (size_t size); - size_t high_water_mark (void); - - void low_water_mark (size_t size); - size_t low_water_mark (void); - - void msg_size (size_t size); - size_t msg_size (void); - - void iterations (size_t n); - size_t iterations (void); - - void n_lwps (size_t n); - size_t n_lwps (void); - - void t_flags (long flag); - long t_flags (void); - - size_t count (void); - - int debug (void); - int verbose (void); - int do_checksum (void); - int do_generate (void); - int do_ack (void); - int do_delete (void); - int do_eager_exit (void); - int do_print_summary (void); - int do_udp (void); - int do_xdr (void); - int do_zero_copy (void); - void print_results (void); - - ACE_Atomic_Op<ACE_Thread_Mutex, size_t> msg_count; // Keep track of number of messages atomically. - int *thr_work_count; // Count activity per-thread. - int thr_wc_size; // Max number of threads. - -private: - ACE_Profile_Timer _itimer; // Keep track of time. - char *_service_entry; // Name of the shared object file and shared object. - char *_mapped_file; // Name of the mapped file. - char *_pipe_addr; // Name of the STREAM pipe. - size_t _sleep_time; // Time to sleep. - size_t _n_lwps; // Number of LWPs. - size_t _thr_count; // Number of threads to spawn. - long _t_flags; // Flags to thr_create(). - size_t _high_water_mark; // ACE_Queue high water mark. - size_t _low_water_mark; // ACE_Queue low water mark. - size_t _msg_size; // Size of a message. - size_t _initial_queue_length; // Initial number of items in the queue. - size_t _logical_connections; // Number of logical connections. - size_t _physical_connections; // Number of physical connections. - size_t _iterations; // Number of iterations to run the test program. - int _generate; // Generate the data. - int _udp; // Use UDP format. - int _debugging; // Extra debugging info. - int _verbosity; // Extra verbose messages. - int _ack; // Do an acknowledgement. - int _checksum; // Is checksumming enabled?. - int _xdr; // Is xdr conversion enabled?. - int _free_memory; // Are we freeing up memory?. - int _zero_copy; // Implement a zero-copy driver?. - int _print_summary; // Print a summary of the results only. - int _consecutive_ports; // Number of consecutive messages from same port. - int _eager_exit; // Exit eagerly, without cleaning up. -}; - -// Make this available to any code that wants to see it! -extern ACE_Svc_Export Options options; - -#include "Performance_Test_Options.i" -#endif /* ACE_HAS_THREADS */ -#endif /* _OPTIONS_H */ diff --git a/performance-tests/Synch-Benchmarks/Performance_Test_Options.i b/performance-tests/Synch-Benchmarks/Performance_Test_Options.i deleted file mode 100644 index 08abea93bf4..00000000000 --- a/performance-tests/Synch-Benchmarks/Performance_Test_Options.i +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* Option manager for ustreams */ - -#include "ace/Get_Opt.h" - -inline int -Options::do_print_summary (void) -{ - return this->_print_summary; -} - -inline int -Options::do_udp (void) -{ - return this->_udp; -} - -inline void -Options::start_timer (void) -{ - this->_itimer.start (); -} - -inline void -Options::stop_timer (void) -{ - this->_itimer.stop (); -} - -inline int -Options::do_generate (void) -{ - return this->_generate; -} - -inline int -Options::do_ack (void) -{ - return this->_ack; -} - -inline int -Options::do_eager_exit (void) -{ - return this->_eager_exit; -} - -inline int -Options::do_zero_copy (void) -{ - return this->_zero_copy; -} - -inline int -Options::do_checksum (void) -{ - return this->_checksum; -} - -inline int -Options::do_delete (void) -{ - return this->_free_memory; -} - -inline int -Options::do_xdr (void) -{ - return this->_xdr; -} - -inline void -Options::n_lwps (size_t count) -{ - this->_n_lwps = count; -} - -inline size_t -Options::n_lwps (void) -{ - return this->_n_lwps; -} - -inline void -Options::pipe_addr (char *pipe) -{ - this->_pipe_addr = pipe; -} - -inline char * -Options::pipe_addr (void) -{ - return this->_pipe_addr; -} - -inline void -Options::service_entry (char *pipe) -{ - this->_service_entry = pipe; -} - -inline char * -Options::service_entry (void) -{ - return this->_service_entry; -} - -inline void -Options::mapped_file (char *filename) -{ - this->_mapped_file = filename; -} - -inline char * -Options::mapped_file (void) -{ - return this->_mapped_file; -} - -inline void -Options::sleep_time (size_t count) -{ - this->_sleep_time = count; -} - -inline size_t -Options::sleep_time (void) -{ - return this->_sleep_time; -} - -inline void -Options::thr_count (size_t count) -{ - this->_thr_count = count; -} - -inline size_t -Options::thr_count (void) -{ - return this->_thr_count; -} - -inline void -Options::consecutive_ports (size_t count) -{ - this->_consecutive_ports = count; -} - -inline size_t -Options::consecutive_ports (void) -{ - return this->_consecutive_ports; -} - -inline void -Options::logical_connections (size_t count) -{ - this->_logical_connections = count; -} - -inline size_t -Options::logical_connections (void) -{ - return this->_logical_connections; -} - -inline void -Options::physical_connections (size_t count) -{ - this->_physical_connections = count; -} - -inline size_t -Options::physical_connections (void) -{ - return this->_physical_connections; -} - -inline void -Options::initial_queue_length (size_t length) -{ - this->_initial_queue_length = length; -} - -inline size_t -Options::initial_queue_length (void) -{ - return this->_initial_queue_length; -} - -inline void -Options::high_water_mark (size_t size) -{ - this->_high_water_mark = size; -} - -inline size_t -Options::high_water_mark (void) -{ - return this->_high_water_mark; -} - -inline void -Options::low_water_mark (size_t size) -{ - this->_low_water_mark = size; -} - -inline size_t -Options::low_water_mark (void) -{ - return this->_low_water_mark; -} - -inline void -Options::msg_size (size_t size) -{ - this->_msg_size = size; -} - -inline size_t -Options::msg_size (void) -{ - return this->_msg_size; -} - -inline void -Options::iterations (size_t n) -{ - this->_iterations = n; -} - -inline size_t -Options::iterations (void) -{ - return this->_iterations; -} - -inline void -Options::t_flags (long flag) -{ - this->_t_flags |= flag; -} - -inline long -Options::t_flags (void) -{ - return this->_t_flags; -} - -inline int -Options::debug (void) -{ - return this->_debugging; -} - -inline int -Options::verbose (void) -{ - return this->_verbosity; -} diff --git a/performance-tests/Synch-Benchmarks/adaptive_mutex_test.cpp b/performance-tests/Synch-Benchmarks/adaptive_mutex_test.cpp deleted file mode 100644 index fcbb0078c1f..00000000000 --- a/performance-tests/Synch-Benchmarks/adaptive_mutex_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Adaptive_Lock_Performance_Test_Base.h" - -ACE_RCSID(Synch_Benchmarks, adaptive_mutex_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Adaptive_Mutex_Test : public Adaptive_Lock_Performance_Test_Base -{ -public: - virtual int init (int, char *[]); -}; - -int -Adaptive_Mutex_Test::init (int, char *[]) -{ - ACE_Lock *lock; - ACE_NEW_RETURN (lock, - ACE_Lock_Adapter<ACE_Thread_Mutex> (), - -1); - - return this->set_lock (lock); -} - -ACE_SVC_FACTORY_DECLARE (Adaptive_Mutex_Test) -ACE_SVC_FACTORY_DEFINE (Adaptive_Mutex_Test) - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Lock_Adapter<ACE_Thread_Mutex>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Lock_Adapter<ACE_Thread_Mutex> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/adaptive_recursive_lock_test.cpp b/performance-tests/Synch-Benchmarks/adaptive_recursive_lock_test.cpp deleted file mode 100644 index 4eaf4a46af0..00000000000 --- a/performance-tests/Synch-Benchmarks/adaptive_recursive_lock_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Adaptive_Lock_Performance_Test_Base.h" - -ACE_RCSID(Synch_Benchmarks, adaptive_recursive_lock_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Adaptive_Recursive_Lock_Test : public Adaptive_Lock_Performance_Test_Base -{ -public: - virtual int init (int, char *[]); -}; - -int -Adaptive_Recursive_Lock_Test::init (int, char *[]) -{ - ACE_Lock *lock; - ACE_NEW_RETURN (lock, - ACE_Lock_Adapter<ACE_Recursive_Thread_Mutex> (), - -1); - - return this->set_lock (lock); -} - -ACE_SVC_FACTORY_DECLARE (Adaptive_Recursive_Lock_Test) -ACE_SVC_FACTORY_DEFINE (Adaptive_Recursive_Lock_Test) - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Lock_Adapter<ACE_Recursive_Thread_Mutex>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Lock_Adapter<ACE_Recursive_Thread_Mutex> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/adaptive_sema_test.cpp b/performance-tests/Synch-Benchmarks/adaptive_sema_test.cpp deleted file mode 100644 index 7f9c9f5886b..00000000000 --- a/performance-tests/Synch-Benchmarks/adaptive_sema_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Adaptive_Lock_Performance_Test_Base.h" - -ACE_RCSID(Synch_Benchmarks, adaptive_sema_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Adaptive_Sema_Test : public Adaptive_Lock_Performance_Test_Base -{ -public: - virtual int init (int, char *[]); - -private: - static ACE_Semaphore sema; -}; - -ACE_Semaphore Adaptive_Sema_Test::sema (1); - -int -Adaptive_Sema_Test::init (int, char *[]) -{ - ACE_Lock *lock; - ACE_NEW_RETURN (lock, - ACE_Lock_Adapter<ACE_Semaphore> (Adaptive_Sema_Test::sema), - -1); - - return this->set_lock (lock); -} - -ACE_SVC_FACTORY_DECLARE (Adaptive_Sema_Test) -ACE_SVC_FACTORY_DEFINE (Adaptive_Sema_Test) - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Lock_Adapter<ACE_Semaphore>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Lock_Adapter<ACE_Semaphore> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/condb_test.cpp b/performance-tests/Synch-Benchmarks/condb_test.cpp deleted file mode 100644 index 51ebc1995e3..00000000000 --- a/performance-tests/Synch-Benchmarks/condb_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, condb_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Cond_Brdcast_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Thread_Mutex mutex; - static int resources; - - static ACE_Condition_Thread_Mutex notfull; - static ACE_Condition_Thread_Mutex notempty; -}; - -ACE_Thread_Mutex Cond_Brdcast_Test::mutex; -int Cond_Brdcast_Test::resources; -ACE_Condition_Thread_Mutex Cond_Brdcast_Test::notfull (Cond_Brdcast_Test::mutex); -ACE_Condition_Thread_Mutex Cond_Brdcast_Test::notempty (Cond_Brdcast_Test::mutex); - -int -Cond_Brdcast_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - // Special case for first thread... - if (ni == 4) - while (!this->done ()) - { - mutex.acquire (); - while (resources > 0) - notfull.wait (); - options.thr_work_count[ni]++; - resources = options.thr_count () - 1; - buffer++; - notempty.broadcast (); - mutex.release (); - } - else - while (!this->done ()) - { - mutex.acquire (); - while (resources == 0) - notempty.wait (); - options.thr_work_count[ni]++; - buffer++; - if (--resources == 0) - notfull.signal (); - mutex.release (); - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Cond_Brdcast_Test) -ACE_SVC_FACTORY_DEFINE (Cond_Brdcast_Test) - -// ACE_Service_Object_Type cbt (&cond_brdcast_test, "Condition_Broadcast_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/conds_test.cpp b/performance-tests/Synch-Benchmarks/conds_test.cpp deleted file mode 100644 index 69399994b37..00000000000 --- a/performance-tests/Synch-Benchmarks/conds_test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, conds_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Cond_Signal_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Thread_Mutex mutex; - static int resources; - - static ACE_Condition_Thread_Mutex notfull; - static ACE_Condition_Thread_Mutex notempty; -}; - -ACE_Thread_Mutex Cond_Signal_Test::mutex; -int Cond_Signal_Test::resources; -ACE_Condition_Thread_Mutex Cond_Signal_Test::notfull (Cond_Signal_Test::mutex); -ACE_Condition_Thread_Mutex Cond_Signal_Test::notempty (Cond_Signal_Test::mutex); - -int -Cond_Signal_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - // This is a horrible hack and only works for Solaris threads. This - // clearly needs to change... - if (ni == 4) - while (!this->done ()) - { - mutex.acquire (); - - while (resources > 0) - notfull.wait (); - - options.thr_work_count[ni]++; - resources = options.thr_count () - 1; - buffer++; - notempty.signal (); - mutex.release (); - } - else - while (!this->done ()) - { - mutex.acquire (); - while (resources == 0) - notempty.wait (); - options.thr_work_count[ni]++; - buffer++; - if (--resources == 0) - notfull.signal (); - mutex.release (); - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Cond_Signal_Test) -ACE_SVC_FACTORY_DEFINE (Cond_Signal_Test) - -// ACE_Service_Object_Type cst (&cond_signal_test, "Condition_Signal_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/context_test.cpp b/performance-tests/Synch-Benchmarks/context_test.cpp deleted file mode 100644 index 22a99db3fd5..00000000000 --- a/performance-tests/Synch-Benchmarks/context_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, context_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Context_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); -}; - -int -Context_Test::svc (void) -{ - int ni = this->thr_id (); - - synch_count = 1; - - while (!this->done ()) - { - ACE_Thread::yield (); - options.thr_work_count[ni]++; - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Context_Test) -ACE_SVC_FACTORY_DEFINE (Context_Test) - -// ACE_Service_Object_Type ct (&context_test, "Context_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/memory_test.cpp b/performance-tests/Synch-Benchmarks/memory_test.cpp deleted file mode 100644 index 0921bb14f60..00000000000 --- a/performance-tests/Synch-Benchmarks/memory_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, memory_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Memory_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); -}; - -int -Memory_Test::svc (void) -{ - int ni = this->thr_id (); - size_t length = options.msg_size (); - char *from = new char[length]; - char *to = new char[length]; - - synch_count = 1; - - while (!this->done ()) - { - ACE_OS::memcpy (to, from, length); - options.thr_work_count[ni]++; - } - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Memory_Test) -ACE_SVC_FACTORY_DEFINE (Memory_Test) - -// ACE_Service_Object_Type mt (&memory_test, "Memory_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/mutex_test.cpp b/performance-tests/Synch-Benchmarks/mutex_test.cpp deleted file mode 100644 index 73d159b1d57..00000000000 --- a/performance-tests/Synch-Benchmarks/mutex_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, mutex_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Mutex_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Thread_Mutex mutex; -}; - -ACE_Thread_Mutex Mutex_Test::mutex; - -int -Mutex_Test::svc (void) -{ - // Extract out the unique thread-specific value to be used as an - // index... - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - mutex.acquire (); - options.thr_work_count[ni]++; - buffer++; - mutex.release (); - } - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Mutex_Test) -ACE_SVC_FACTORY_DEFINE (Mutex_Test) - -// ACE_Service_Object_Type mut (&mutex_test, "Mutex_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp b/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp deleted file mode 100644 index 28183279647..00000000000 --- a/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, pipe_proc_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Pipe_Proc_Test : public Benchmark_Performance -{ -public: - int init (int, char **); - virtual int svc (void); - -private: - ACE_HANDLE pipe_handles[2]; - - void reader (ACE_HANDLE handle); -}; - -int -Pipe_Proc_Test::init (int, char **) -{ - synch_count = 1; - - if (ACE_OS::pipe (this->pipe_handles) == -1) - ACE_OS::perror ("pipe"), ACE_OS::exit (1); - - switch (ACE_OS::fork ()) - { - case -1: - ACE_OS::perror ("fork"), ACE_OS::exit (1); - case 0: - this->reader (pipe_handles[0]); - /* NOTREACHED */ - break; - default: - break; - } - return 1; -} - -void -Pipe_Proc_Test::reader (ACE_HANDLE handle) -{ - int ni = this->thr_id (); - int length = options.msg_size (); - char *to; - - ACE_NEW (to, char[length]); - - while (ACE_OS::read (handle, to, length) > 0) - options.thr_work_count[ni]++; -} - - -int -Pipe_Proc_Test::svc (void) -{ - ssize_t length = options.msg_size (); - int ni = this->thr_id (); - ACE_HANDLE handle = this->pipe_handles[1]; - char *from; - - ACE_NEW_RETURN (from, char[length], -1); - - while (!this->done ()) - if (ACE_OS::write (handle, from, length) == length) - options.thr_work_count[ni]++; - else - ACE_OS::perror ("write"); - - ACE_OS::close (this->pipe_handles[0]); - ACE_OS::close (this->pipe_handles[1]); - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Pipe_Proc_Test) -ACE_SVC_FACTORY_DEFINE (Pipe_Proc_Test) - -// ACE_Service_Object_Type ppt (&pipe_proc_test, "Pipe_Proc_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp b/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp deleted file mode 100644 index 6088b104f97..00000000000 --- a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Thread_Manager.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, pipe_thr_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Pipe_Thr_Test : public Benchmark_Performance -{ -public: - virtual int init (int, char **); - virtual int svc (void); - -private: - ACE_HANDLE pipe_handles[2]; - - static void *reader (Pipe_Thr_Test *); -}; - -void * -Pipe_Thr_Test::reader (Pipe_Thr_Test *t) -{ - ACE_HANDLE handle = t->pipe_handles[0]; - int ni = t->thr_id (); - size_t length = options.msg_size (); - char *to; - ACE_NEW_RETURN (to, char[length], 0); - - while (ACE_OS::read (handle, to, length) > 0) - options.thr_work_count[ni]++; - - return 0; -} - -int -Pipe_Thr_Test::init (int, char **) -{ - synch_count = 1; - - if (ACE_OS::pipe (this->pipe_handles) == -1) - ACE_OS::perror ("pipe"), ACE_OS::exit (1); - - if (ACE_Thread_Manager::instance ()->spawn - (ACE_THR_FUNC (Pipe_Thr_Test::reader), - (void *) this, options.t_flags ()) == -1) - ACE_OS::perror ("thr_create"), ACE_OS::exit (1); - - return 1; -} - -int -Pipe_Thr_Test::svc (void) -{ - ssize_t length = options.msg_size (); - ACE_HANDLE handle = this->pipe_handles[1]; - char *from; - ACE_NEW_RETURN (from, char[length], -1); - - while (!this->done ()) - if (ACE_OS::write (handle, from, length) != length) - ACE_OS::perror ("write"); - - ACE_OS::close (this->pipe_handles[0]); - ACE_OS::close (this->pipe_handles[1]); - - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Pipe_Thr_Test) -ACE_SVC_FACTORY_DEFINE (Pipe_Thr_Test) - -// ACE_Service_Object_Type ptt (&pipe_thr_test, "Pipe_Thr_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/recursive_lock_test.cpp b/performance-tests/Synch-Benchmarks/recursive_lock_test.cpp deleted file mode 100644 index df0c18688d3..00000000000 --- a/performance-tests/Synch-Benchmarks/recursive_lock_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, recursive_lock_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Recursive_Lock_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Recursive_Thread_Mutex mutex; -}; - -ACE_Recursive_Thread_Mutex Recursive_Lock_Test::mutex; - -int -Recursive_Lock_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - this->mutex.acquire (); - options.thr_work_count[ni]++; - buffer++; - this->mutex.release (); - } - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Recursive_Lock_Test) -ACE_SVC_FACTORY_DEFINE (Recursive_Lock_Test) - -// ACE_Service_Object_Type rlt (&recursive_lock_test, "Recursive_Lock_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/rwrd_test.cpp b/performance-tests/Synch-Benchmarks/rwrd_test.cpp deleted file mode 100644 index 78aa5b34e14..00000000000 --- a/performance-tests/Synch-Benchmarks/rwrd_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, rwrd_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export RWRD_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_RW_Mutex rw_lock; -}; - -ACE_RW_Mutex RWRD_Test::rw_lock; - -int -RWRD_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - rw_lock.acquire_read (); - options.thr_work_count[ni]++; - buffer++; - rw_lock.release (); - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (RWRD_Test) -ACE_SVC_FACTORY_DEFINE (RWRD_Test) - -// ACE_Service_Object_Type rwrdt (&rwrd_test, "RWRD_Mutex_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/rwwr_test.cpp b/performance-tests/Synch-Benchmarks/rwwr_test.cpp deleted file mode 100644 index 99a9983b0c3..00000000000 --- a/performance-tests/Synch-Benchmarks/rwwr_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, rwwr_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export RWWR_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_RW_Mutex rw_lock; -}; - -ACE_RW_Mutex RWWR_Test::rw_lock; - -int -RWWR_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - rw_lock.acquire_write (); - options.thr_work_count[ni]++; - buffer++; - rw_lock.release (); - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (RWWR_Test) -ACE_SVC_FACTORY_DEFINE (RWWR_Test) - -// ACE_Service_Object_Type rwwrt (&rwwr_test, "RWWR_Mutext_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/sema_test.cpp b/performance-tests/Synch-Benchmarks/sema_test.cpp deleted file mode 100644 index 625c3929548..00000000000 --- a/performance-tests/Synch-Benchmarks/sema_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Synch.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, sema_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Sema_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Semaphore sema; -}; - -ACE_Semaphore Sema_Test::sema (1); - -int -Sema_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - sema.acquire (); - options.thr_work_count[ni]++; - buffer++; - sema.release (); - } - - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Sema_Test) -ACE_SVC_FACTORY_DEFINE (Sema_Test) - -// ACE_Service_Object_Type semt (&sema_test, "Semaphore_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/sysvsema_test.cpp b/performance-tests/Synch-Benchmarks/sysvsema_test.cpp deleted file mode 100644 index 95b8cda7c2f..00000000000 --- a/performance-tests/Synch-Benchmarks/sysvsema_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/SV_Semaphore_Simple.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, sysvsema_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export SYSVSema_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_SV_Semaphore_Simple sema; -}; - -ACE_SV_Semaphore_Simple SYSVSema_Test::sema ((key_t) 1234); - -int -SYSVSema_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - sema.acquire (); - options.thr_work_count[ni]++; - buffer++; - sema.release (); - } - - sema.remove (); - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (SYSVSema_Test) -ACE_SVC_FACTORY_DEFINE (SYSVSema_Test) - -// ACE_Service_Object_Type st (&sysvsema_test, "SYSVSema_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/token_test.cpp b/performance-tests/Synch-Benchmarks/token_test.cpp deleted file mode 100644 index 1b686f9d8b5..00000000000 --- a/performance-tests/Synch-Benchmarks/token_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Token.h" -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -ACE_RCSID(Synch_Benchmarks, token_test, "$Id$") - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Token_Test : public Benchmark_Performance -{ -public: - virtual int svc (void); - -private: - static ACE_Token token; -}; - -ACE_Token Token_Test::token; - -int -Token_Test::svc (void) -{ - // Extract out the unique thread-specific value to be used as an - // index... - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - token.acquire (); - options.thr_work_count[ni]++; - buffer++; - token.release (); - } - /* NOTREACHED */ - return 0; -} - -ACE_SVC_FACTORY_DECLARE (Token_Test) -ACE_SVC_FACTORY_DEFINE (Token_Test) - -// ACE_Service_Object_Type tok (&token_test, "Token_Test"); -#endif /* ACE_HAS_THREADS */ |