gtsam
Loading...
Searching...
No Matches
PriorityScheduler.h File Reference

Priority-based task scheduler. More...

Go to the source code of this file.

Classes

struct  gtsam::detail::PrioritySchedulerPolicy
 Queue policy for PriorityScheduler: min-heap priority_queue by task priority. More...
struct  gtsam::detail::PrioritySchedulerPolicy::Compare< TaskPtr >

Namespaces

namespace  gtsam
 Global functions in a separate testing namespace.

Typedefs

template<typename Y>
using gtsam::PriorityScheduler = Scheduler<Y, detail::PrioritySchedulerPolicy>
 Thread pool scheduler that prioritizes tasks by numeric priority.

Detailed Description

Priority-based task scheduler.

This header defines a small, thread-based scheduler that executes tasks in priority order. A lower numeric priority is executed before a higher numeric priority (min-heap behavior). Tasks return a value of type Y, and callers can wait on results via std::future<Y>.

This is implemented as a policy specialization of gtsam::Scheduler.

Example
auto future = scheduler.schedule(0, [] { return 42; });
int value = future.get();
Scheduler< Y, detail::PrioritySchedulerPolicy > PriorityScheduler
Thread pool scheduler that prioritizes tasks by numeric priority.
Definition PriorityScheduler.h:93
Author
Frank Dellaert
Date
May, 2025