Implement local scheduler task queues using C++ data structures (#392)

* Switch to using C++ lists for task queues

* Init and free methods for TaskQueueEntry

* Switch from utarray to c++ vector for TaskQueueEntry

* Get rid of some pointers

* Back to O(1) deletion from waiting_task_queue

* Fix comments

* Cut code

* Non const iterators

* Fix Alexey's comments
This commit is contained in:
Stephanie Wang
2017-03-30 00:40:01 -07:00
committed by Robert Nishihara
parent 8245758ccb
commit 036b873bf2
3 changed files with 168 additions and 145 deletions
+13
View File
@@ -275,6 +275,19 @@ double TaskSpec_get_required_resource(const TaskSpec *spec,
return message->required_resources()->Get(resource_index);
}
bool TaskSpec_is_dependent_on(TaskSpec *spec, ObjectID object_id) {
int64_t num_args = TaskSpec_num_args(spec);
for (int i = 0; i < num_args; ++i) {
if (TaskSpec_arg_by_ref(spec, i)) {
ObjectID arg_id = TaskSpec_arg_id(spec, i);
if (ObjectID_equal(arg_id, object_id)) {
return true;
}
}
}
return false;
}
void TaskSpec_free(TaskSpec *spec) {
free(spec);
}