summaryrefslogtreecommitdiff
path: root/performance-tests/Synch-Benchmarks/memory_test.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
commita5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch)
treebcf0a25c3d45a209a6e3ac37b233a4812f29c732 /performance-tests/Synch-Benchmarks/memory_test.cpp
downloadATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz
Initial revision
Diffstat (limited to 'performance-tests/Synch-Benchmarks/memory_test.cpp')
-rw-r--r--performance-tests/Synch-Benchmarks/memory_test.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/performance-tests/Synch-Benchmarks/memory_test.cpp b/performance-tests/Synch-Benchmarks/memory_test.cpp
new file mode 100644
index 00000000000..612e86999d0
--- /dev/null
+++ b/performance-tests/Synch-Benchmarks/memory_test.cpp
@@ -0,0 +1,42 @@
+#include "ace/Synch.h"
+// @(#)memory_test.cpp 1.1 10/18/96
+
+#include "Options.h"
+#include "Benchmark.h"
+
+#if defined (ACE_HAS_THREADS)
+
+class Memory_Test : public Benchmark
+{
+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;
+}
+
+extern "C" ACE_Service_Object *memory_test (void);
+
+ACE_Service_Object *memory_test (void)
+{
+ return new Memory_Test;
+}
+
+// ACE_Service_Object_Type mt (&memory_test, "Memory_Test");
+#endif /* ACE_HAS_THREADS */