5 * @author Venkita Subramonian (venkita@cs.wustl.edu)
10 #include /**/ "ace/pre.h"
11 #include "ace/Containers_T.h"
12 #include "ace/Time_Value.h"
13 #include "ace/Message_Block.h"
14 #include "ace/Sched_Params.h"
15 #include "ace/Malloc_Allocator.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "kokyu_export.h"
25 typedef long Priority_t
;
26 typedef ACE_Time_Value Deadline_t
; //absolute deadline
27 typedef ACE_Time_Value Execution_Time_t
; //execution time
30 enum Dispatching_Type_t
31 // Defines the type of prioritization strategy
32 // to be used by a dispatching queue
40 // Defines the criticality of the operation.
41 // For use with Dynamic Scheduler.
51 // Defines the importance of the operation,
52 // which can be used by the RtecScheduler as a
53 // "tie-breaker" when other scheduling
54 // parameters are equal.
63 struct Kokyu_Export Reordering_Queue_Attributes
65 Reordering_Queue_Attributes ();
66 unsigned long static_bit_field_mask_
;
67 unsigned long static_bit_field_shift_
;
68 unsigned long dynamic_priority_max_
;
69 unsigned long dynamic_priority_offset_
;
72 struct Kokyu_Export ConfigInfo
74 Priority_t preemption_priority_
;
76 // OS priority of the dispatching thread associated with the queue
77 Priority_t thread_priority_
;
79 // type of dispatching queue
80 Dispatching_Type_t dispatching_type_
;
82 //allocator to be used for dynamic memory allocation. If each
83 //thread gets its own memory pool, contention will be less
84 ACE_Allocator
*allocator_
;
86 Reordering_Queue_Attributes reordering_flags_
;
91 typedef ACE_Array
<ConfigInfo
> ConfigInfoSet
;
93 class Kokyu_Export Dispatcher_Attributes
96 ConfigInfoSet config_info_set_
;
97 int immediate_activation_
;
100 Dispatcher_Attributes ();
101 void sched_policy (int);
102 void sched_scope (int);
103 int thread_creation_flags () const;
108 int base_thread_creation_flags_
;
112 struct Kokyu_Export QoSDescriptor
114 Priority_t preemption_priority_
;
115 Deadline_t deadline_
;
116 Execution_Time_t execution_time_
;
117 Importance_t importance_
;
120 enum Block_Flag_t
{BLOCK
, UNBLOCK
};
122 class Kokyu_Export Dispatch_Command
125 Dispatch_Command(int dont_delete
= 0,
126 ACE_Allocator
*allocator
= 0);
127 //dont_delete indicates whether this object needs to be deleted once processed.
128 //allocator indicates the ACE_Allocator, if any, from which this object was created.
129 //This same allocator has to be used for the deletion also
132 virtual int execute () = 0;
134 int can_be_deleted () const;
139 // only inheritance is possible and object should be on heap,
140 // since object could be handed over to a different thread.
141 virtual ~Dispatch_Command ();
145 ACE_Allocator
*allocator_
;
146 //if this object has to be deleted, then delete it using the allocator
150 enum DSRT_Sched_Type_t
157 enum DSRT_Dispatcher_Impl_t
163 struct Kokyu_Export DSRT_ConfigInfo
166 DSRT_Sched_Type_t sched_strategy_
;
168 ACE_Sched_Params::Policy sched_policy_
;
171 //type of implementation
172 DSRT_Dispatcher_Impl_t impl_type_
;
178 //to satisfy ACE_Array<ConfigInfo>
179 ACE_INLINE
bool operator != (const Kokyu::ConfigInfo
& lhs
, const Kokyu::ConfigInfo
& rhs
);
181 #if defined (__ACE_INLINE__)
182 #include "Kokyu_defs.inl"
183 #endif /* __ACE_INLINE__ */
185 #include /**/ "ace/post.h"
186 #endif /* KOKYU_DEFS_H */