Commit cf15b2b6 by Tobias Langer

Switched from global task queue to global priority queue.

parent 429e58d6
...@@ -130,7 +130,7 @@ void mtapi_initialize( ...@@ -130,7 +130,7 @@ void mtapi_initialize(
} }
#ifdef EMBB_HARD_REALTIME #ifdef EMBB_HARD_REALTIME
embb_mtapi_task_queue_initialize_with_capacity( embb_mtapi_priority_queue_initialize_with_capacity(
&node->global_task_queue, &node->global_task_queue,
node->attributes.max_tasks); node->attributes.max_tasks);
#endif #endif
...@@ -209,7 +209,7 @@ void mtapi_finalize(MTAPI_OUT mtapi_status_t* status) { ...@@ -209,7 +209,7 @@ void mtapi_finalize(MTAPI_OUT mtapi_status_t* status) {
} }
#ifdef EMBB_HARD_REALTIME #ifdef EMBB_HARD_REALTIME
embb_mtapi_task_queue_finalize(&node->global_task_queue); embb_mtapi_priority_queue_finalize(&node->global_task_queue);
#endif #endif
/* free system instance */ /* free system instance */
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <embb_mtapi_log.h> #include <embb_mtapi_log.h>
#ifdef EMBB_HARD_REALTIME #ifdef EMBB_HARD_REALTIME
#include <embb_mtapi_task_queue_t.h> #include <embb_mtapi_priority_queue_t.h>
#endif /*EMBB_HARD_REALTIME*/ #endif /*EMBB_HARD_REALTIME*/
#ifdef __cplusplus #ifdef __cplusplus
...@@ -76,7 +76,7 @@ struct embb_mtapi_node_struct { ...@@ -76,7 +76,7 @@ struct embb_mtapi_node_struct {
embb_atomic_int is_scheduler_running; embb_atomic_int is_scheduler_running;
mtapi_affinity_t affinity_all; mtapi_affinity_t affinity_all;
#ifdef EMBB_HARD_REALTIME #ifdef EMBB_HARD_REALTIME
embb_mtapi_task_queue_t global_task_queue; embb_mtapi_priority_queue_t global_task_queue;
#endif /*EMBB_HARD_REALTIME*/ #endif /*EMBB_HARD_REALTIME*/
}; };
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <embb_mtapi_task_context_t.h> #include <embb_mtapi_task_context_t.h>
#include <embb_mtapi_task_t.h> #include <embb_mtapi_task_t.h>
#ifdef EMBB_HARD_REALTIME #ifdef EMBB_HARD_REALTIME
#include <embb_mtapi_task_queue_t.h> #include <embb_mtapi_priority_queue_t.h>
#endif /*EMBB_HARD_REALTIME*/ #endif /*EMBB_HARD_REALTIME*/
#include <embb_mtapi_action_t.h> #include <embb_mtapi_action_t.h>
#include <embb_mtapi_alloc.h> #include <embb_mtapi_alloc.h>
...@@ -181,7 +181,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_gedf( ...@@ -181,7 +181,7 @@ embb_mtapi_task_t * embb_mtapi_scheduler_get_next_task_gedf(
assert(MTAPI_NULL != that); assert(MTAPI_NULL != that);
assert(MTAPI_NULL != node); assert(MTAPI_NULL != node);
task = embb_mtapi_task_queue_pop(&node->global_task_queue); task = embb_mtapi_priority_queue_pop(&node->global_task_queue);
return task; return task;
} }
...@@ -649,7 +649,7 @@ mtapi_boolean_t embb_mtapi_scheduler_schedule_task( ...@@ -649,7 +649,7 @@ mtapi_boolean_t embb_mtapi_scheduler_schedule_task(
/* one more task in flight for this action */ /* one more task in flight for this action */
embb_atomic_fetch_and_add_int(&local_action->num_tasks, 1); embb_atomic_fetch_and_add_int(&local_action->num_tasks, 1);
pushed = embb_mtapi_task_queue_push(&node->global_task_queue, task); pushed = embb_mtapi_priority_queue_push(&node->global_task_queue, task);
if (!pushed) { if (!pushed) {
embb_atomic_fetch_and_add_int(&local_action->num_tasks, -1); embb_atomic_fetch_and_add_int(&local_action->num_tasks, -1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment