mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
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:
committed by
Robert Nishihara
parent
8245758ccb
commit
036b873bf2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user