diff options
Diffstat (limited to 'performance-tests/Synch-Benchmarks/Perf_Test')
29 files changed, 0 insertions, 2328 deletions
diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.cpp deleted file mode 100644 index 32ad7ea5431..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#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 (); - performance_test_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/Perf_Test/Adaptive_Lock_Performance_Test_Base.h b/performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.h deleted file mode 100644 index 9fb65628ea8..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Adaptive_Lock_Performance_Test_Base.h +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -#ifndef 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, ACE_TCHAR *[]) = 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/Perf_Test/Benchmark_Performance.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.cpp deleted file mode 100644 index 12d240b29fe..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.cpp +++ /dev/null @@ -1,59 +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; - -Benchmark_Performance_Test_Base::Benchmark_Performance_Test_Base (void) - : Benchmark_Base (Benchmark_Base::PERFORMANCE) -{ -} - -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, ACE_TCHAR **) -{ - return 1; -} - -int -Benchmark_Performance::info (ACE_TCHAR **, 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 ? (long)-1 : (long)0); -} - -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.h b/performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.h deleted file mode 100644 index b66a83048a7..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Benchmark_Performance.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* Defines the class used to dynamically link in the benchmark tests */ - -#ifndef ACE_BENCHMARK_PERFORMANCE_H -#define ACE_BENCHMARK_PERFORMANCE_H - -#include "Synch_Lib/Benchmark_Base.h" - -#if defined (ACE_HAS_THREADS) - -#include "ace/svc_export.h" - -extern int buffer; -extern ACE_Svc_Export int synch_count; - -class ACE_Svc_Export Benchmark_Performance_Test_Base : public Benchmark_Base -{ - // = TITLE - // This class identifies itself as Benmarking Performance Test class. -protected: - Benchmark_Performance_Test_Base (void); -}; - -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, ACE_TCHAR *[]); - virtual int info (ACE_TCHAR **, 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/Perf_Test/Makefile.am b/performance-tests/Synch-Benchmarks/Perf_Test/Makefile.am deleted file mode 100644 index af2ca99fc92..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Makefile.am +++ /dev/null @@ -1,61 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu - -ACE_BUILDDIR = $(top_builddir) -ACE_ROOT = $(top_srcdir) - -## Makefile.Synch_Benchmarks_Perf_Test.am -noinst_LTLIBRARIES = libSynch_Benchmarks_Perf_Test.la - -libSynch_Benchmarks_Perf_Test_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(srcdir)/.. - -libSynch_Benchmarks_Perf_Test_la_SOURCES = \ - Adaptive_Lock_Performance_Test_Base.cpp \ - Benchmark_Performance.cpp \ - Performance_Test.cpp \ - Performance_Test_Options.cpp \ - adaptive_mutex_test.cpp \ - adaptive_recursive_lock_test.cpp \ - adaptive_sema_test.cpp \ - condb_test.cpp \ - conds_test.cpp \ - context_test.cpp \ - guard_test.cpp \ - memory_test.cpp \ - mutex_test.cpp \ - pipe_proc_test.cpp \ - pipe_thr_test.cpp \ - recursive_lock_test.cpp \ - rwrd_test.cpp \ - rwwr_test.cpp \ - sema_test.cpp \ - sysvsema_test.cpp \ - token_test.cpp - -libSynch_Benchmarks_Perf_Test_la_LIBADD = \ - $(top_builddir)/performance-tests/Synch-Benchmarks/Synch_Lib/libSynch_Lib.la $(top_builddir)/ace/libACE.la - -noinst_HEADERS = \ - Adaptive_Lock_Performance_Test_Base.h \ - Benchmark_Performance.h \ - Performance_Test.h \ - Performance_Test_Options.h \ - Performance_Test_Options.i - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.cpp deleted file mode 100644 index 42045f5963e..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL - -#include "Performance_Test.h" - -# if defined (ACE_HAS_THREADS) - -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" - -#include "ace/Service_Repository.h" -#include "ace/Reactor.h" - -ACE_RCSID (Perf_Test, - 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, ACE_TCHAR **argv) -{ - ACE_DEBUG ((LM_DEBUG, "Performance_Test::init\n")); - performance_test_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_ = performance_test_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 - (performance_test_options.thr_count (), ACE_THR_FUNC (bp->svc_run), - (void *) bp, performance_test_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 (performance_test_options.sleep_time ()); - - ACE_DEBUG ((LM_DEBUG, "starting timer\n")); - performance_test_options.start_timer (); - - // Use Reactor as a timer (which can be interrupted by a signal). - ACE_Reactor::run_event_loop (timeout); - - performance_test_options.stop_timer (); - ACE_DEBUG ((LM_DEBUG, "\nstopping timer\n")); - - return 0; -} - -int -Performance_Test::post_run_test (void) -{ - // 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", - performance_test_options.t_flags (), - (performance_test_options.t_flags () & THR_DETACHED) ? "THR_DETACHED" : "Not Detached", - (performance_test_options.t_flags () & THR_BOUND) ? "THR_BOUND" : "Not Bound", - (performance_test_options.t_flags () & THR_NEW_LWP) ? "THR_NEW_LWP" : "No New_LWP", - this->orig_n_lwps_, this->n_lwps_, ACE_Thread::getconcurrency ())); - int count = performance_test_options.count (); - float rate = count / (float (performance_test_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)); - performance_test_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 (); - performance_test_options.init (); - - return 0; -} - -int -Performance_Test::valid_test_object (Benchmark_Base *bb) -{ - return (bb->benchmark_type () == Benchmark_Base::PERFORMANCE); -} - -ACE_SVC_FACTORY_DEFINE (Performance_Test) - -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.h b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.h deleted file mode 100644 index f56e8001e76..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#ifndef ACE_PERFORMANCE_TEST_H -#define ACE_PERFORMANCE_TEST_H - -#include "ace/svc_export.h" - -#if defined (ACE_HAS_THREADS) - -#include "Synch_Lib/Benchmark_Base.h" - -class ACE_Svc_Export Performance_Test : public Benchmark_Method_Base -{ -public: - Performance_Test (void); - virtual int init (int argc, ACE_TCHAR *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_HAS_THREADS */ - -#endif /* ACE_PERFORMANCE_TEST_H */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp deleted file mode 100644 index 11c45f3f155..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.cpp +++ /dev/null @@ -1,481 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "Performance_Test_Options.h" -#include "ace/OS_NS_strings.h" - -ACE_RCSID(Synch_Benchmarks, Performance_Test_Options, "$Id$") - -#if defined (ACE_HAS_THREADS) -// Manages the options. -Performance_Test_Options performance_test_options; - -size_t -Performance_Test_Options::count (void) -{ - size_t total = 0; - - if (performance_test_options.verbose ()) - ACE_DEBUG ((LM_DEBUG, "Thread work count size = %d\n", performance_test_options.thr_wc_size)); - - for (int i = 0; i < performance_test_options.thr_wc_size; i++) - { - if (performance_test_options.thr_work_count[i] != 0) - { - // if (performance_test_options.verbose ()) - ACE_DEBUG ((LM_DEBUG, "count[%d] = %d\n", i, performance_test_options.thr_work_count[i])); - total += performance_test_options.thr_work_count[i]; - } - } - - return total; -} - -void -Performance_Test_Options::init (void) -{ - for (int i = 0; i < this->thr_wc_size; i++) - this->thr_work_count[i] = 0; -} - -Performance_Test_Options::Performance_Test_Options (void) - : thr_wc_size (10000), - _service_entry (0), - _mapped_file (0), - _pipe_addr (const_cast<ACE_TCHAR *> (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 -Performance_Test_Options::parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("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': // Not used. (do_ack ???) - this->_ack = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'A': // Not used. (set rendezvous point.) - this->pipe_addr (get_opt.opt_arg ()); - break; - case 'B': // Create thread with THR_BOUND. - this->t_flags (THR_BOUND); - break; - case 'c': // Not used. (# of connections.) - { - long connections = ACE_OS::atoi (get_opt.opt_arg ()); - - 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': // Not used. (Toggle calculate checksum.) - this->_checksum = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'd': // Not used. (Enable debugging.) - this->_debugging = 1; - break; - case 'D': // Create thread with THR_DETACHED. - this->t_flags (THR_DETACHED); - break; - case 'e': // Perform eager exit (without cleaning up.) - this->_eager_exit = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'F': // Not used. - this->_free_memory = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'g': // Not used. (generate data ??) - this->_generate = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'H': // Not used. (set high water mark) - this->high_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'i': // Not used. (# of iterations) - this->iterations (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'L': // Not used. (set low water mark) - this->low_water_mark (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'l': // Not used. (set initial queue length) - this->initial_queue_length (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'M': // Set message size in pipe_[proc|thr]_test. - this->msg_size (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'm': // Not used. (set mapped file name) - this->mapped_file (get_opt.opt_arg ()); - break; - case 'N': // Create thread with flag THR_NEW_LWP. - this->t_flags (THR_NEW_LWP); - break; - case 'n': // Set # of lwp's - this->n_lwps (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'p': // Toggle whether summary is printed. - this->_print_summary = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'P': // Not used. - this->consecutive_ports (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'S': // Not used (set service_entry ???) - this->service_entry (get_opt.opt_arg ()); - break; - case 's': // Set testing duration. - this->sleep_time (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'T': // Enable/disable tracing. -#if defined (ACE_HAS_TRACE) - if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0) - ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("OFF")) == 0) - ACE_Trace::stop_tracing (); -#endif /* ACE_HAS_TRACE */ - break; - case 't': // Set # of threads contending the lock. - this->thr_count (ACE_OS::atoi (get_opt.opt_arg ())); - break; - case 'u': // Not used. (use udp.) - this->_udp = 1; - break; - case 'v': // Not used. (set display verbosely) - this->_verbosity = 1; - break; - case 'X': // Not used. (Use xdr conversion.) - this->_xdr = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("ON")) == 0; - break; - case 'Z': // Not used. (Do zero copy.) - this->_zero_copy = ACE_OS::strcasecmp (get_opt.opt_arg (), ACE_TEXT("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 -Performance_Test_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 (performance_test_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>; -template class ACE_Atomic_Op_Ex<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> -#pragma instantiate ACE_Atomic_Op_Ex<ACE_Thread_Mutex, size_t> -#endif /* ACE_MT_SAFE */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.h b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.h deleted file mode 100644 index 9d2285ce343..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// Option manager for performance tests. - -#ifndef _PERFORMANCE_TEST_OPTIONS_H -#define _PERFORMANCE_TEST_OPTIONS_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Profile_Timer.h" -#include "ace/Log_Msg.h" -#include "ace/Thread_Manager.h" -#include "ace/Atomic_Op.h" -#include "ace/svc_export.h" - -#if defined (ACE_HAS_THREADS) - -class ACE_Svc_Export Performance_Test_Options -{ -public: - Performance_Test_Options (void); - void parse_args (int argc, ACE_TCHAR *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 (ACE_TCHAR pipe[]); - ACE_TCHAR *pipe_addr (void); - - void mapped_file (ACE_TCHAR filename[]); - ACE_TCHAR *mapped_file (void); - - void service_entry (ACE_TCHAR *service_entry); - ACE_TCHAR *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. - ACE_TCHAR *_service_entry; // Name of the shared object file and shared object. - ACE_TCHAR *_mapped_file; // Name of the mapped file. - ACE_TCHAR *_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. - size_t _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 Performance_Test_Options performance_test_options; - -#include "Performance_Test_Options.i" -#endif /* ACE_HAS_THREADS */ -#endif /* _PERFORMANCE_TEST_OPTIONS_H */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.i b/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.i deleted file mode 100644 index 6856edfa3cd..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Performance_Test_Options.i +++ /dev/null @@ -1,269 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -/* Option manager for ustreams */ - -#include "ace/Get_Opt.h" - -// Since this is only included in the .h file, these should be -// remain inline, not ACE_INLINE. -// FUZZ: disable check_for_inline - - -inline int -Performance_Test_Options::do_print_summary (void) -{ - return this->_print_summary; -} - -inline int -Performance_Test_Options::do_udp (void) -{ - return this->_udp; -} - -inline void -Performance_Test_Options::start_timer (void) -{ - this->_itimer.start (); -} - -inline void -Performance_Test_Options::stop_timer (void) -{ - this->_itimer.stop (); -} - -inline int -Performance_Test_Options::do_generate (void) -{ - return this->_generate; -} - -inline int -Performance_Test_Options::do_ack (void) -{ - return this->_ack; -} - -inline int -Performance_Test_Options::do_eager_exit (void) -{ - return this->_eager_exit; -} - -inline int -Performance_Test_Options::do_zero_copy (void) -{ - return this->_zero_copy; -} - -inline int -Performance_Test_Options::do_checksum (void) -{ - return this->_checksum; -} - -inline int -Performance_Test_Options::do_delete (void) -{ - return this->_free_memory; -} - -inline int -Performance_Test_Options::do_xdr (void) -{ - return this->_xdr; -} - -inline void -Performance_Test_Options::n_lwps (size_t count) -{ - this->_n_lwps = count; -} - -inline size_t -Performance_Test_Options::n_lwps (void) -{ - return this->_n_lwps; -} - -inline void -Performance_Test_Options::pipe_addr (ACE_TCHAR *pipe) -{ - this->_pipe_addr = pipe; -} - -inline ACE_TCHAR * -Performance_Test_Options::pipe_addr (void) -{ - return this->_pipe_addr; -} - -inline void -Performance_Test_Options::service_entry (ACE_TCHAR *pipe) -{ - this->_service_entry = pipe; -} - -inline ACE_TCHAR * -Performance_Test_Options::service_entry (void) -{ - return this->_service_entry; -} - -inline void -Performance_Test_Options::mapped_file (ACE_TCHAR *filename) -{ - this->_mapped_file = filename; -} - -inline ACE_TCHAR * -Performance_Test_Options::mapped_file (void) -{ - return this->_mapped_file; -} - -inline void -Performance_Test_Options::sleep_time (size_t count) -{ - this->_sleep_time = count; -} - -inline size_t -Performance_Test_Options::sleep_time (void) -{ - return this->_sleep_time; -} - -inline void -Performance_Test_Options::thr_count (size_t count) -{ - this->_thr_count = count; -} - -inline size_t -Performance_Test_Options::thr_count (void) -{ - return this->_thr_count; -} - -inline void -Performance_Test_Options::consecutive_ports (size_t count) -{ - this->_consecutive_ports = count; -} - -inline size_t -Performance_Test_Options::consecutive_ports (void) -{ - return this->_consecutive_ports; -} - -inline void -Performance_Test_Options::logical_connections (size_t count) -{ - this->_logical_connections = count; -} - -inline size_t -Performance_Test_Options::logical_connections (void) -{ - return this->_logical_connections; -} - -inline void -Performance_Test_Options::physical_connections (size_t count) -{ - this->_physical_connections = count; -} - -inline size_t -Performance_Test_Options::physical_connections (void) -{ - return this->_physical_connections; -} - -inline void -Performance_Test_Options::initial_queue_length (size_t length) -{ - this->_initial_queue_length = length; -} - -inline size_t -Performance_Test_Options::initial_queue_length (void) -{ - return this->_initial_queue_length; -} - -inline void -Performance_Test_Options::high_water_mark (size_t size) -{ - this->_high_water_mark = size; -} - -inline size_t -Performance_Test_Options::high_water_mark (void) -{ - return this->_high_water_mark; -} - -inline void -Performance_Test_Options::low_water_mark (size_t size) -{ - this->_low_water_mark = size; -} - -inline size_t -Performance_Test_Options::low_water_mark (void) -{ - return this->_low_water_mark; -} - -inline void -Performance_Test_Options::msg_size (size_t size) -{ - this->_msg_size = size; -} - -inline size_t -Performance_Test_Options::msg_size (void) -{ - return this->_msg_size; -} - -inline void -Performance_Test_Options::iterations (size_t n) -{ - this->_iterations = n; -} - -inline size_t -Performance_Test_Options::iterations (void) -{ - return this->_iterations; -} - -inline void -Performance_Test_Options::t_flags (long flag) -{ - this->_t_flags |= flag; -} - -inline long -Performance_Test_Options::t_flags (void) -{ - return this->_t_flags; -} - -inline int -Performance_Test_Options::debug (void) -{ - return this->_debugging; -} - -inline int -Performance_Test_Options::verbose (void) -{ - return this->_verbosity; -} diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/README b/performance-tests/Synch-Benchmarks/Perf_Test/README deleted file mode 100644 index 28f1f160e8a..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/README +++ /dev/null @@ -1,76 +0,0 @@ -The files in this directory support controlled benchmarking of the ACE -synchronization mechanisms. - - These mechanisms include: - - . Mutexes - . Reader/writer locks - . Condition variables - . Semaphores - . Tokens - . Adaptive lockings - -There are additional tests that measure the memory bandwidth under the -following conditions: - - . User memory-to-memory copying of data within a single thread - . User memory-to-kernel-to-user memory copying via pipes - between separate processes, as well as between separate - threads in the same process - -There are many options available for this module that can be put into -svc.conf files. See the Performance_Test_Options.[Chi] file for more -details. Some reasonable options to use to run the tests are: - - -v -B -s 15 - -v -n 4 -t 4 -s 15 - -You should experiment with other options as you see fit. Note that on -Solaris, you should always make sure that you have more than 1 LWP (by -using either the -B or the -n options) since otherwise the program may -get into an infinite loop due to the semantics of SunOS unbound -threads... (This may no longer be the case.) - - -Available Options in Performance_Test module: -============================================= - -Thread Creation: ----------------- - -B: Create thread with THR_BOUND - -D: Create thread with THR_DETACHED - -N: Create thread with flag THR_NEW_LWP - -n: Set # of lwp's (default is 0) - -t: Set # of threads contending the lock (default is 4) - -Run Test: ---------- - -s: Set testing duration (in seconds, default is 100) - -T: Enable/disable tracing. - -Misc: ------ - -p: Toggle whether summary is printed - -e: Perform eager exit (without cleaning up) - -M: Set message size in pipe_[proc|thr]_test - -Reserved Flags: ---------------- - -a: Not used. (do_ack ???) - -A: Not used. (set rendezvous point) - -c: Not used. (# of connections) - -C: Not used. (Toggle calculate checksum) - -d: Not used. (Enable debugging) - -F: Not used. (Free memory) - -g: Not used. (generate data ??) - -H: Not used. (set high water mark) - -i: Not used. (# of iterations) - -L: Not used. (set low water mark) - -l: Not used. (set initial queue length) - -m: Not used. (set mapped file name) - -P: Not used. (set consecutive ports) - -S: Not used. (set service_entry ???) - -u: Not used. (use udp) - -v: Not used. (set display verbosely) - -X: Not used. (Use xdr conversion) - -Z: Not used. (Do zero copy) diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/Synch_Benchmarks_Perf_Test.mpc b/performance-tests/Synch-Benchmarks/Perf_Test/Synch_Benchmarks_Perf_Test.mpc deleted file mode 100644 index 1c6fd932a6b..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/Synch_Benchmarks_Perf_Test.mpc +++ /dev/null @@ -1,10 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : acelib { - avoids += ace_for_tao - after += Synch_Lib - libs += Synch_Lib - libpaths += ../Synch_Lib - includes += .. -}
\ No newline at end of file diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_mutex_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_mutex_test.cpp deleted file mode 100644 index 4a72ec2ac90..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_mutex_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Log_Msg.h" -#include "Adaptive_Lock_Performance_Test_Base.h" -#include "ace/Lock_Adapter_T.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, ACE_TCHAR *[]); -}; - -int -Adaptive_Mutex_Test::init (int, ACE_TCHAR *[]) -{ - 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/Perf_Test/adaptive_recursive_lock_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_recursive_lock_test.cpp deleted file mode 100644 index a439127e9c4..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_recursive_lock_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Log_Msg.h" -#include "Adaptive_Lock_Performance_Test_Base.h" -#include "ace/Lock_Adapter_T.h" -#include "ace/Recursive_Thread_Mutex.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, ACE_TCHAR *[]); -}; - -int -Adaptive_Recursive_Lock_Test::init (int, ACE_TCHAR *[]) -{ - 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/Perf_Test/adaptive_sema_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_sema_test.cpp deleted file mode 100644 index 605d4ffb338..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/adaptive_sema_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Log_Msg.h" -#include "Adaptive_Lock_Performance_Test_Base.h" -#include "ace/Semaphore.h" -#include "ace/Lock_Adapter_T.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, ACE_TCHAR *[]); - -private: - static ACE_Semaphore sema; -}; - -ACE_Semaphore Adaptive_Sema_Test::sema (1); - -int -Adaptive_Sema_Test::init (int, ACE_TCHAR *[]) -{ - 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/Perf_Test/condb_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/condb_test.cpp deleted file mode 100644 index 432f741b9e7..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/condb_test.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#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 (); - performance_test_options.thr_work_count[ni]++; - resources = performance_test_options.thr_count () - 1; - buffer++; - notempty.broadcast (); - mutex.release (); - } - else - while (!this->done ()) - { - mutex.acquire (); - while (resources == 0) - notempty.wait (); - performance_test_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/Perf_Test/conds_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/conds_test.cpp deleted file mode 100644 index a930727861b..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/conds_test.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#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 (); - - performance_test_options.thr_work_count[ni]++; - resources = performance_test_options.thr_count () - 1; - buffer++; - notempty.signal (); - mutex.release (); - } - else - while (!this->done ()) - { - mutex.acquire (); - while (resources == 0) - notempty.wait (); - performance_test_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/Perf_Test/context_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/context_test.cpp deleted file mode 100644 index fc4fa0dc26d..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/context_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#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 (); - performance_test_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/Perf_Test/guard_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/guard_test.cpp deleted file mode 100644 index e1824f3d4ac..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/guard_test.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Guard_T.h" -#include "ace/Log_Msg.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 Guard_Test : public Benchmark_Performance -{ -public: - enum - { // svc.conf options - TEST_ACE_GUARD, // -g - TEST_ACE_THREAD_MUTEX_GUARD // -t - }; - - virtual int svc (void); - virtual int init (int, ACE_TCHAR *[]); - - void test_guard (int); -#if defined (ACE_USES_OBSOLETE_GUARD_CLASSES) - void test_thread_guard (int); -#endif /* ACE_USES_OBSOLETE_GUARD_CLASSES */ -private: - static int guard_type_; - static ACE_Thread_Mutex mutex_; -}; - -int Guard_Test::guard_type_ = Guard_Test::TEST_ACE_GUARD; -ACE_Thread_Mutex Guard_Test::mutex_; - -int -Guard_Test::init (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt getopt (argc, argv, ACE_TEXT("gt")); - int c; - - while ((c = getopt()) != -1) - { - switch (c) - { -#if defined (ACE_USES_OBSOLETE_GUARD_CLASSES) - case 't': - Guard_Test::guard_type_ = Guard_Test::TEST_ACE_THREAD_MUTEX_GUARD; - break; -#endif /* ACE_USES_OBSOLETE_GUARD_CLASSES */ - case 'g': - Guard_Test::guard_type_ = Guard_Test::TEST_ACE_GUARD; - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "Invalid option\n"), -1); - } - } - return 0; -} - -int -Guard_Test::svc (void) -{ - // Extract out the unique thread-specific value to be used as an - // index... - int ni = this->thr_id (); - synch_count = 2; - - switch (Guard_Test::guard_type_) - { - case Guard_Test::TEST_ACE_GUARD: - this->test_guard (ni); - break; -#if defined (ACE_USES_OBSOLETE_GUARD_CLASSES) - case Guard_Test::TEST_ACE_THREAD_MUTEX_GUARD: - this->test_thread_guard (ni); - break; -#endif /* ACE_USES_OBSOLETE_GUARD_CLASSES */ - default: - return -1; - } - return 0; -} - -void -Guard_Test::test_guard (int ni) -{ - while (!this->done ()) - { - { - ACE_GUARD (ACE_Thread_Mutex, _ace_mon, Guard_Test::mutex_); - - performance_test_options.thr_work_count[ni]++; - buffer++; - } - } -} - -#if defined (ACE_USES_OBSOLETE_GUARD_CLASSES) -# define ACE_THREAD_GUARD(OBJ,LOCK) \ - ACE_Thread_Mutex_Guard OBJ (LOCK); \ - if (OBJ.locked () == 0) return; - -void -Guard_Test::test_thread_guard (int ni) -{ - while (!this->done ()) - { - { - ACE_THREAD_GUARD (_ace_mon, Guard_Test::mutex_); - - performance_test_options.thr_work_count[ni]++; - buffer++; - } - } -} -#endif /* ACE_USES_OBSOLETE_GUARD_CLASSES */ -ACE_SVC_FACTORY_DECLARE (Guard_Test) -ACE_SVC_FACTORY_DEFINE (Guard_Test) - -// ACE_Service_Object_Type mut (&mutex_test, "Guard_Test"); -#endif /* ACE_HAS_THREADS */ diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/memory_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/memory_test.cpp deleted file mode 100644 index 9d0bcd6c7d1..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/memory_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/OS_NS_string.h" -#include "ace/Log_Msg.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 = performance_test_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); - performance_test_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/Perf_Test/mutex_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/mutex_test.cpp deleted file mode 100644 index c1e0a1e0ad0..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/mutex_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#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 (); - performance_test_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/Perf_Test/pipe_proc_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/pipe_proc_test.cpp deleted file mode 100644 index 10bed9b88f3..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/pipe_proc_test.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#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, ACE_TCHAR **); - virtual int svc (void); - -private: - ACE_HANDLE pipe_handles[2]; - - void reader (ACE_HANDLE handle); -}; - -int -Pipe_Proc_Test::init (int, ACE_TCHAR **) -{ - synch_count = 1; - - if (ACE_OS::pipe (this->pipe_handles) == -1) - ACE_OS::perror (ACE_TEXT("pipe")), ACE_OS::exit (1); - - switch (ACE_OS::fork ()) - { - case -1: - ACE_OS::perror (ACE_TEXT("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 = performance_test_options.msg_size (); - char *to; - - ACE_NEW (to, char[length]); - - while (ACE_OS::read (handle, to, length) > 0) - performance_test_options.thr_work_count[ni]++; -} - - -int -Pipe_Proc_Test::svc (void) -{ - ssize_t length = performance_test_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) - performance_test_options.thr_work_count[ni]++; - else - ACE_OS::perror (ACE_TEXT("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/Perf_Test/pipe_thr_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/pipe_thr_test.cpp deleted file mode 100644 index 895b5a846fe..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/pipe_thr_test.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#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, ACE_TCHAR **); - 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 = performance_test_options.msg_size (); - char *to; - ACE_NEW_RETURN (to, char[length], 0); - - while (ACE_OS::read (handle, to, length) > 0) - performance_test_options.thr_work_count[ni]++; - - return 0; -} - -int -Pipe_Thr_Test::init (int, ACE_TCHAR **) -{ - synch_count = 1; - - if (ACE_OS::pipe (this->pipe_handles) == -1) - ACE_OS::perror (ACE_TEXT("pipe")), ACE_OS::exit (1); - - if (ACE_Thread_Manager::instance ()->spawn - (ACE_THR_FUNC (Pipe_Thr_Test::reader), - (void *) this, performance_test_options.t_flags ()) == -1) - ACE_OS::perror (ACE_TEXT("thr_create")), ACE_OS::exit (1); - - return 1; -} - -int -Pipe_Thr_Test::svc (void) -{ - ssize_t length = performance_test_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 (ACE_TEXT("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/Perf_Test/recursive_lock_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/recursive_lock_test.cpp deleted file mode 100644 index 6246835ee88..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/recursive_lock_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/Recursive_Thread_Mutex.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 (); - performance_test_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/Perf_Test/rwrd_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/rwrd_test.cpp deleted file mode 100644 index a0eb5c6cff8..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/rwrd_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/RW_Mutex.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 (); - performance_test_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/Perf_Test/rwwr_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/rwwr_test.cpp deleted file mode 100644 index 1c7a25eae1f..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/rwwr_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "ace/RW_Mutex.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 (); - performance_test_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/Perf_Test/sema_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/sema_test.cpp deleted file mode 100644 index 9f1d7657139..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/sema_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#define ACE_BUILD_SVC_DLL -#include "Performance_Test_Options.h" -#include "Benchmark_Performance.h" -#include "ace/Semaphore.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 (); - performance_test_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/Perf_Test/sysvsema_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp deleted file mode 100644 index 5899e4f1a75..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp +++ /dev/null @@ -1,67 +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 init (int, ACE_TCHAR *[]); - virtual int fini (void); - virtual int svc (void); - -private: - static ACE_SV_Semaphore_Simple *sema; -}; - - -ACE_SV_Semaphore_Simple *SYSVSema_Test::sema = 0; - -int -SYSVSema_Test::init (int, ACE_TCHAR *[]) -{ -#if defined (ACE_HAS_SYSV_IPC) - ACE_NEW_RETURN (SYSVSema_Test::sema, ACE_SV_Semaphore_Simple ((key_t) 1234), -1); - return 0; -#else - ACE_ERROR_RETURN ((LM_ERROR, "SysV Semaphore not supported on this platform.\n"), -1); -#endif /* ACE_HAS_SYSV_IPC */ -} - -int -SYSVSema_Test::fini (void) -{ - delete SYSVSema_Test::sema; - return 0; -} - -int -SYSVSema_Test::svc (void) -{ - int ni = this->thr_id (); - synch_count = 2; - - while (!this->done ()) - { - SYSVSema_Test::sema->acquire (); - performance_test_options.thr_work_count[ni]++; - buffer++; - SYSVSema_Test::sema->release (); - } - - SYSVSema_Test::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/Perf_Test/token_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/token_test.cpp deleted file mode 100644 index fe66740feca..00000000000 --- a/performance-tests/Synch-Benchmarks/Perf_Test/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 (); - performance_test_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 */ |