summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-21 01:00:00 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-21 01:00:00 +0000
commit6f1fb1d9c4f585955be5803221986d4599996a70 (patch)
treeed304c86937a0a2deecb5af3bf1d2b50b2e455d7 /TAO/orbsvcs
parent0887b5ff711b37290ac3e2364640799bcb5fc549 (diff)
downloadATCD-6f1fb1d9c4f585955be5803221986d4599996a70.tar.gz
ChangeLogTag:Mon Mar 20 16:54:20 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r--TAO/orbsvcs/tests/Event/Event.dsw15
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Connect.dsp4
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ECPerformance.dsw12
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Inversion.cpp151
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Inversion.dsp102
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Inversion.h55
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Makefile3
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Throughput.dsp4
8 files changed, 341 insertions, 5 deletions
diff --git a/TAO/orbsvcs/tests/Event/Event.dsw b/TAO/orbsvcs/tests/Event/Event.dsw
index 56d717e5a68..0b9f113ae94 100644
--- a/TAO/orbsvcs/tests/Event/Event.dsw
+++ b/TAO/orbsvcs/tests/Event/Event.dsw
@@ -105,6 +105,21 @@ Package=<4>
###############################################################################
+Project: "Inversion"=.\Performance\Inversion.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name ECTest
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "MT_Disconnect"=.\Basic\MT_Disconnect.dsp - Package Owner=<4>
Package=<5>
diff --git a/TAO/orbsvcs/tests/Event/Performance/Connect.dsp b/TAO/orbsvcs/tests/Event/Performance/Connect.dsp
index a0481e0e7ac..f9eecc75ae9 100644
--- a/TAO/orbsvcs/tests/Event/Performance/Connect.dsp
+++ b/TAO/orbsvcs/tests/Event/Performance/Connect.dsp
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ECTest.lib TAO.lib ace.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+# ADD LINK32 TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib ECTest.lib TAO.lib ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
!ELSEIF "$(CFG)" == "Connect - Win32 Debug"
@@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ECTestd.lib TAOd.lib aced.lib TAO_CosNamingd.lib TAO_RTEventd.lib TAO_RTSchedd.lib TAO_Svc_Utilsd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+# ADD LINK32 TAO_CosNamingd.lib TAO_RTEventd.lib TAO_RTSchedd.lib TAO_Svc_Utilsd.lib ECTestd.lib TAOd.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
!ENDIF
diff --git a/TAO/orbsvcs/tests/Event/Performance/ECPerformance.dsw b/TAO/orbsvcs/tests/Event/Performance/ECPerformance.dsw
index 451125d4714..538b9c5381e 100644
--- a/TAO/orbsvcs/tests/Event/Performance/ECPerformance.dsw
+++ b/TAO/orbsvcs/tests/Event/Performance/ECPerformance.dsw
@@ -15,6 +15,18 @@ Package=<4>
###############################################################################
+Project: "Inversion"=.\Inversion.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "Throughput"=.\Throughput.dsp - Package Owner=<4>
Package=<5>
diff --git a/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp b/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp
new file mode 100644
index 00000000000..7fa11c70f5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp
@@ -0,0 +1,151 @@
+// $Id$
+
+#include "Inversion.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "ace/Sched_Params.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID(EC_Tests_Performance, Inversion, "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Inversion driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Inversion::EC_Inversion (void)
+{
+}
+
+int
+EC_Inversion::parse_args (int &argc, char *argv [])
+{
+ int r = this->EC_Driver::parse_args (argc, argv);
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Inversion (%P|%t) "
+ "adjusting number of consumers (2)\n"));
+ this->n_consumers_ = 2;
+ return r;
+}
+
+void
+EC_Inversion::connect_consumers (CORBA::Environment &ACE_TRY_ENV)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ ACE_ConsumerQOS_Factory qos0;
+ qos0.start_disjunction_group (2);
+ qos0.insert_type (ACE_ES_EVENT_UNDEFINED, 0);
+ qos0.insert_type (ACE_ES_EVENT_UNDEFINED + 1, 0);
+
+ this->consumers_[0]->connect (consumer_admin,
+ qos0.get_ConsumerQOS (),
+ ACE_ES_EVENT_UNDEFINED + 1,
+ ACE_TRY_ENV);
+
+ ACE_ConsumerQOS_Factory qos1;
+ qos1.start_disjunction_group (2);
+ qos1.insert_type (ACE_ES_EVENT_UNDEFINED + 2, 0);
+ qos1.insert_type (ACE_ES_EVENT_UNDEFINED + 3, 0);
+
+ this->consumers_[1]->connect (consumer_admin,
+ qos1.get_ConsumerQOS (),
+ ACE_ES_EVENT_UNDEFINED + 3,
+ ACE_TRY_ENV);
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Inversion (%P|%t) connected consumer(s)\n"));
+}
+
+void
+EC_Inversion::connect_suppliers (CORBA::Environment &ACE_TRY_ENV)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_TRY_ENV);
+ ACE_CHECK;
+
+ ACE_SupplierQOS_Factory qos0;
+ qos0.insert (1, ACE_ES_EVENT_UNDEFINED, 0, 1);
+ qos0.insert (1, ACE_ES_EVENT_UNDEFINED + 1, 0, 1);
+
+ this->suppliers_[0]->connect (supplier_admin,
+ qos0.get_SupplierQOS (),
+ ACE_ES_EVENT_UNDEFINED + 1,
+ ACE_TRY_ENV);
+
+ for (int j = 1; j != this->n_suppliers_; ++j)
+ {
+ ACE_SupplierQOS_Factory qos1;
+ qos1.insert (1, ACE_ES_EVENT_UNDEFINED + 2, 0, 1);
+ qos1.insert (1, ACE_ES_EVENT_UNDEFINED + 3, 0, 1);
+
+ this->suppliers_[j]->connect (supplier_admin,
+ qos1.get_SupplierQOS (),
+ ACE_ES_EVENT_UNDEFINED + 3,
+ ACE_TRY_ENV);
+ }
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Inversion (%P|%t) connected supplier(s)\n"));
+}
+
+void
+EC_Inversion::activate_tasks (CORBA::Environment &)
+{
+ int priority;
+
+ if (ACE_BIT_ENABLED (this->thr_create_flags_, THR_SCHED_FIFO))
+ {
+ priority =
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO);
+ }
+ else
+ {
+ priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_OTHER);
+ }
+ if (this->tasks_[0]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Inversion (%P|%t) cannot activate high prio task\n"));
+ }
+
+ if (ACE_BIT_ENABLED (this->thr_create_flags_, THR_SCHED_FIFO))
+ {
+ priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ }
+ else
+ {
+ priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_OTHER);
+ }
+
+ for (int i = 1; i < this->n_suppliers_; ++i)
+ {
+ if (this->tasks_[i]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Inversion (%P|%t) Cannot activate thread "
+ "for supplier %d\n%p\n",
+ i, "EC_Inversion - OS error is:"));
+ }
+ }
+}
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+
+#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/Event/Performance/Inversion.dsp b/TAO/orbsvcs/tests/Event/Performance/Inversion.dsp
new file mode 100644
index 00000000000..aedea12e800
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Inversion.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="Inversion" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Inversion - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Inversion.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Inversion.mak" CFG="Inversion - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Inversion - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Inversion - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Inversion - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\lib" /I "..\..\.." /I "..\..\..\.." /I "..\..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ECTest.lib TAO.lib ace.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+
+!ELSEIF "$(CFG)" == "Inversion - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\lib" /I "..\..\.." /I "..\..\..\.." /I "..\..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ECTestd.lib TAOd.lib aced.lib TAO_CosNamingd.lib TAO_RTEventd.lib TAO_RTSchedd.lib TAO_Svc_Utilsd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "Inversion - Win32 Release"
+# Name "Inversion - Win32 Debug"
+# Begin Group "Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=.\Inversion.h
+# End Source File
+# End Group
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".cpp"
+# Begin Source File
+
+SOURCE=.\Inversion.cpp
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/orbsvcs/tests/Event/Performance/Inversion.h b/TAO/orbsvcs/tests/Event/Performance/Inversion.h
new file mode 100644
index 00000000000..a2b67821103
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Inversion.h
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel testsuite
+//
+// = FILENAME
+// Inversion
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_INVERSION_H
+#define EC_INVERSION_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EC_Inversion : public EC_Driver
+{
+ //
+ // = TITLE
+ // Measure priority inversions in the EC.
+ //
+ // = DESCRIPTION
+ //
+public:
+ EC_Inversion (void);
+ // Constructor
+
+ // = The EC_Driver methods
+ int parse_args (int &argc, char *argv[]);
+ // Parse the arguments, but override the number of consumers.
+ // The options controlling the event types are ignored, and only two
+ // consumers are created.
+
+ virtual void connect_consumers (CORBA::Environment &ACE_TRY_ENV);
+ virtual void connect_suppliers (CORBA::Environment &ACE_TRY_ENV);
+ // In this test there are two consumers, the high priority consumer
+ // receives only events from a single high priority supplier. The
+ // other consumer receives events from a set of low priority
+ // suppliers.
+
+ virtual void activate_tasks (CORBA::Environment &);
+ // Activate the suppliers at different priorities
+};
+
+#endif /* EC_INVERSION_H */
diff --git a/TAO/orbsvcs/tests/Event/Performance/Makefile b/TAO/orbsvcs/tests/Event/Performance/Makefile
index f37a6b04425..6e3278d1bb1 100644
--- a/TAO/orbsvcs/tests/Event/Performance/Makefile
+++ b/TAO/orbsvcs/tests/Event/Performance/Makefile
@@ -13,7 +13,8 @@ ifndef TAO_ROOT
endif # ! TAO_ROOT
BIN2 = Throughput \
- Connect
+ Connect \
+ Inversion
#### If the orbsvcs library wasn't built with all components, don't
#### try to build certain tests.
diff --git a/TAO/orbsvcs/tests/Event/Performance/Throughput.dsp b/TAO/orbsvcs/tests/Event/Performance/Throughput.dsp
index 759fb37482d..362af80da45 100644
--- a/TAO/orbsvcs/tests/Event/Performance/Throughput.dsp
+++ b/TAO/orbsvcs/tests/Event/Performance/Throughput.dsp
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ECTest.lib TAO.lib ace.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+# ADD LINK32 TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib ECTest.lib TAO.lib ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
!ELSEIF "$(CFG)" == "Throughput - Win32 Debug"
@@ -74,7 +74,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ECTestd.lib TAOd.lib aced.lib TAO_CosNamingd.lib TAO_RTEventd.lib TAO_RTSchedd.lib TAO_Svc_Utilsd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+# ADD LINK32 TAO_CosNamingd.lib TAO_RTEventd.lib TAO_RTSchedd.lib TAO_Svc_Utilsd.lib ECTestd.lib TAOd.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib" /libpath:"..\..\..\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
!ENDIF