summaryrefslogtreecommitdiff
path: root/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'performance-tests/Cubit/TAO/MT_Cubit/Globals.h')
-rw-r--r--performance-tests/Cubit/TAO/MT_Cubit/Globals.h142
1 files changed, 69 insertions, 73 deletions
diff --git a/performance-tests/Cubit/TAO/MT_Cubit/Globals.h b/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
index 63b5a7940ad..21b99dcb31e 100644
--- a/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
+++ b/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
@@ -1,25 +1,22 @@
// -*- C++ -*-
-// $Id$
#ifndef GLOBALS_H
#define GLOBALS_H
-// ============================================================================
-//
-// = LIBRARY
-// TAO/tests
-//
-// = FILENAME
-// Globals.h
-//
-// = DESCRIPTION
-// All the globally defined classes, functions, types, and #defines
-// are centralized here.
-//
-// = AUTHOR
-// Nagarajan Surendran <naga@cs.wustl.edu>
-//
-// ============================================================================
+//=============================================================================
+/**
+ * @file Globals.h
+ *
+ * $Id$
+ *
+ * All the globally defined classes, functions, types, and #defines
+ * are centralized here.
+ *
+ *
+ * @author Nagarajan Surendran <naga@cs.wustl.edu>
+ */
+//=============================================================================
+
#include "ace/config-all.h"
@@ -62,15 +59,6 @@ ACE_Sched_Params::priority_max(ACE_SCHED_FIFO,ACE_SCOPE_THREAD)
ACE_THR_PRI_FIFO_DEF + 25
#endif /* ! __Lynx__ */
-#if defined (CHORUS_MVME)
-#define PCCTIMER_INIT {int pTime;/*Initialize the PCC timer chip */pccTimerInit ();\
-if (pccTimer (PCC2_TIMER1_START, &pTime) != K_OK)\
-ACE_DEBUG ((LM_DEBUG,"pccTimer has a pending benchmark\n"));\
-}
-#else /* !CHORUS_MVME */
-#define PCCTIMER_INIT
-#endif /* !CHORUS_MVME */
-
#if defined (VXWORKS) && defined (FORCE_ARGS)
static char *force_argv[]=
{
@@ -108,112 +96,120 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Barrier;
ACE_END_VERSIONED_NAMESPACE_DECL
+/**
+ * @class Globals
+ *
+ * @brief Globals class to be used as a singleton.
+ *
+ * This is used both by the server and client.
+ */
class Globals
{
- // = TITLE
- // Globals class to be used as a singleton.
- //
- // = DESCRIPTION
- // This is used both by the server and client.
public:
+ /// default constructor.
Globals (void);
- // default constructor.
+ /// parse the arguments.
int parse_args (int argc, ACE_TCHAR **argv);
- // parse the arguments.
+ /**
+ * Enables fifo scheduling eg., RT scheduling class on solaris.
+ * Returns 0 on success, 1 if insufficient permission, or -1
+ * for other failure. As a side effect, sets thr_create_flags
+ * appropriately.
+ */
static int sched_fifo_init (void);
- // Enables fifo scheduling eg., RT scheduling class on solaris.
- // Returns 0 on success, 1 if insufficient permission, or -1
- // for other failure. As a side effect, sets thr_create_flags
- // appropriately.
+ /// Thread creation flags. Must call sched_fifo_init () before
+ /// accessing.
long thr_create_flags;
- // Thread creation flags. Must call sched_fifo_init () before
- // accessing.
+ /// Default thread priority, used for the high thread priority.
+ /// Must call sched_fifo_init () before accessing.
int default_priority;
- // Default thread priority, used for the high thread priority.
- // Must call sched_fifo_init () before accessing.
+ /// endpoint to be used for ORB_init.
ACE_TCHAR endpoint[BUFSIZ];
- // endpoint to be used for ORB_init.
+ /// file name to read/write the iors of the servants.
ACE_TCHAR *ior_file;
- // file name to read/write the iors of the servants.
+ /// number of objects per servant thread.
u_int num_of_objs;
- // number of objects per servant thread.
+ /// thread_per_rate test flag.
u_int thread_per_rate;
- // thread_per_rate test flag.
+ /// flag to use multiple priorities for the low priority servants
+ /// instead of one priority.
u_int use_multiple_priority;
- // flag to use multiple priorities for the low priority servants
- // instead of one priority.
+ /// ready flag used by the high priority thread to wake up the low
+ /// priority threads after it's parsed the arguments.
int ready_;
- // ready flag used by the high priority thread to wake up the low
- // priority threads after it's parsed the arguments.
+ /// mutex for the condition variable.
TAO_SYNCH_MUTEX ready_mtx_;
- // mutex for the condition variable.
+ /// condition variable for the low priority threads to wait
+ ///until the high priority thread is done with the arguments parsing.
TAO_SYNCH_CONDITION ready_cnd_;
- // condition variable for the low priority threads to wait
- //until the high priority thread is done with the arguments parsing.
+ /// Barrier for the multiple servants to synchronize after binding to
+ /// the orb.
ACE_Barrier *barrier_;
- // Barrier for the multiple servants to synchronize after binding to
- // the orb.
};
// Make the globals a Singleton.
typedef ACE_Singleton<Globals,ACE_Null_Mutex> GLOBALS;
+/**
+ * @class MT_Priority
+ *
+ * @brief Helper class to find high and low priorities for the
+ * MT_Cubit application over multiple platforms.
+ *
+ * This class has 2 methods, one for the high priority and the
+ * other for low priority.If the flag use_multiple_priority is
+ * passed then multiple priorities are used for the low priority
+ * threads.
+ */
class MT_Priority
{
- // = TITLE
- // Helper class to find high and low priorities for the
- // MT_Cubit application over multiple platforms.
- //
- // = DESCRIPTION
- // This class has 2 methods, one for the high priority and the
- // other for low priority.If the flag use_multiple_priority is
- // passed then multiple priorities are used for the low priority
- // threads.
public:
+ /// constructor.
MT_Priority (void);
- // constructor.
/// Destructor.
virtual ~MT_Priority (void);
+ /// Sets the priority of the high priority thread.
virtual ACE_Sched_Priority get_high_priority (void);
- // Sets the priority of the high priority thread.
+ /// Sets the priority to be used for the low priority thread.
virtual ACE_Sched_Priority get_low_priority
(u_int num_low_priority,
ACE_Sched_Priority prev_priority,
u_int use_multiple_priority);
- // Sets the priority to be used for the low priority thread.
+ /// Accessor for num_priorities_.
u_int number_of_priorities (void);
- // Accessor for num_priorities_.
+ /// Accessor for grain_.
u_int grain (void);
- // Accessor for grain_.
protected:
+ /// Number of priorities used.
u_int num_priorities_;
- // Number of priorities used.
+ /**
+ * Granularity of the assignment of the priorities. Some OSs have
+ * fewer levels of priorities than we have threads in our test, so
+ * with this mechanism we assign priorities to groups of threads
+ * when there are more threads than priorities.
+ */
u_int grain_;
- // Granularity of the assignment of the priorities. Some OSs have
- // fewer levels of priorities than we have threads in our test, so
- // with this mechanism we assign priorities to groups of threads
- // when there are more threads than priorities.
};
#endif /* GLOBALS_H */