summaryrefslogtreecommitdiff
path: root/ace/Sched_Params.h
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-29 04:01:33 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-29 04:01:33 +0000
commit45f6114ba2581a7d1dec2bd8a9b84aeb876e052a (patch)
tree0680ad1b72afefe67e5c973324783b5553f32e11 /ace/Sched_Params.h
parentc01e57bb9e0e5e2e88bb885d24aa7b56bf0e0660 (diff)
downloadATCD-45f6114ba2581a7d1dec2bd8a9b84aeb876e052a.tar.gz
added ACE_OS::set_sched_params (), and ACE_Scheduling_Parameters and ACE_Thread_Priority classes
Diffstat (limited to 'ace/Sched_Params.h')
-rw-r--r--ace/Sched_Params.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/ace/Sched_Params.h b/ace/Sched_Params.h
new file mode 100644
index 00000000000..b4936b769dc
--- /dev/null
+++ b/ace/Sched_Params.h
@@ -0,0 +1,77 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// ACE
+//
+// = FILENAME
+// Scheduling_Params.h
+//
+// = CREATION DATE
+// 28 January 1997
+//
+// = AUTHOR
+// David Levine
+//
+// ============================================================================
+
+#if ! defined (SCHEDULING_PARAMS_H)
+#define SCHEDULING_PARAMS_H
+
+#include "ace/Thread_Priority.h"
+#include "ace/OS.h" // for ACE_Time_Value and ACE_SCOPE_PROCESS
+
+class ACE_Scheduling_Params
+{
+public:
+ ACE_Scheduling_Params (
+ const ACE_Thread_Priority &priority = ACE_Thread_Priority (),
+ const int scope = ACE_SCOPE_PROCESS,
+ const ACE_Time_Value &quantum = ACE_Time_Value::zero);
+ // default priority: sets the priority to be used for newly spawned threads.
+ // It is intended that this function be called from main () before
+ // any threads have been spawned. If spawned threads inherit their
+ // parent's priority (I think that's the case for all of our platforms),
+ // then this sets the default base priority. Individual thread
+ // priorities can be adjusted as usual.
+ //
+ // "scope" must be either ACE_SCOPE_PROCESS or ACE_SCOPE_LWP (which is
+ // only used on Solaris, and ignored on Win32 and VxWorks)
+ //
+ // The "quantum" is for time slicing. An ACE_Time_Value of 0 has
+ // special significance: it means time-slicing is disabled; with
+ // that, a thread that is running on a CPU will continue to run until
+ // it blocks or is preempted. Currently ignored if the OS doesn't
+ // directly support time slicing, such as on VxWorks, or setting the
+ // quantum (can that be done on Win32?).
+
+ ~ACE_Scheduling_Params ();
+
+ // get/set accessors:
+
+ const ACE_Thread_Priority &priority () const;
+ void set_priority (const ACE_Thread_Priority &);
+
+ int scope () const;
+ void set_scope(const int);
+
+ const ACE_Time_Value &quantum () const;
+ void set_quantum (const ACE_Time_Value &);
+
+private:
+ ACE_Thread_Priority priority_;
+ int scope_;
+ ACE_Time_Value quantum_;
+};
+
+
+#if defined (__ACE_INLINE__)
+#include "ace/Scheduling_Params.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* SCHEDULING_PARAMS_H */
+
+
+// EOF