summaryrefslogtreecommitdiff
path: root/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-09 21:20:42 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-09 21:20:42 +0000
commit39a716d9cd71ef6d713e4d74dcda17607e30291c (patch)
tree9bde58ad63b5a7dd9b52760578f1161f25f1ea08 /performance-tests/Synch-Benchmarks/pipe_proc_test.cpp
parent18e674e6bab51409d45bb4aae99a5bd6e5767410 (diff)
downloadATCD-0_8_2.tar.gz
This commit was manufactured by cvs2svn to create tag 'v0_8_2'.v0_8_2
Diffstat (limited to 'performance-tests/Synch-Benchmarks/pipe_proc_test.cpp')
-rw-r--r--performance-tests/Synch-Benchmarks/pipe_proc_test.cpp85
1 files changed, 0 insertions, 85 deletions
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 7d9c74d190d..00000000000
--- a/performance-tests/Synch-Benchmarks/pipe_proc_test.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "Options.h"
-// $Id$
-
-#include "Benchmark.h"
-
-#if defined (ACE_HAS_THREADS)
-
-extern int buffer;
-extern int synch_count;
-
-class Pipe_Proc_Test : public Benchmark
-{
-public:
- int init (int, char **);
- virtual int svc (void);
-
-private:
- int 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 = new char[length];
- int n;
-
- while ((n = ACE_OS::read (handle, to, length)) > 0)
- options.thr_work_count[ni]++;
-}
-
-
-int
-Pipe_Proc_Test::svc (void)
-{
- ssize_t length = options.msg_size ();
- char *from = new char[length];
- int ni = this->thr_id ();
- ACE_HANDLE handle = this->pipe_handles[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;
-}
-
-extern "C" ACE_Service_Object *pipe_proc_test (void);
-
-ACE_Service_Object *pipe_proc_test (void)
-{
- return new Pipe_Proc_Test;
-}
-
-// ACE_Service_Object_Type ppt (&pipe_proc_test, "Pipe_Proc_Test");
-#endif /* ACE_HAS_THREADS */