-
We need a system Orchestrator to
implement the robot behaviorRobot Behaviors
This Coordinator or Task Planner is also the highest level of abstraction of our
system, where we focus on WHAT the robot
0 码力 |
59 页 |
7.97 MB
| 5 月前 3
-
used when we created them.”
- Albert EinsteinSo what is there to
Rethink?Rethinking: Task Queues
Problem #1 - Task Queues Do Not Scale Well:
●
Contention:
○
Even the most meticulously designed lock-free problems:
○
Task starvation
○
Load balancing
○
Forfeits strict FIFO behaviour
○
Increases memory footprint (or requires allocations)
○
Terrible task selection “fairness”
Task
Thread
Thread
Thread
Task
Task Task
Task
Task
Task
Task
Task
Back
Front
Task Queue
Execute Task()
Thread
Thread PoolRethinking: Task Queues
Problem #2 - No Inherent Support For Prioritization:
●
Priority queues address this but
0 码力 |
142 页 |
2.80 MB
| 5 月前 3
-
in a
top-down task graph
What is Task Graph-based Programming System (TGPS)
Code
4• TGPS encapsulates function calls and their dependencies in a
top-down task graph
What is Task Graph-based Programming top-down task graph
What is Task Graph-based Programming System (TGPS)
Code
A
B
C
D
B
A
C
D
6• TGPS encapsulates function calls and their dependencies in a
top-down task graph
What is Task Graph-based sched;
2 task_a = sched.emplace([](&){
3 // Code block A;
4 });
5 task_b = sched.emplace([](&){
6 // Code block B;
7 });
8 task_c = sched.emplace([](&){
9 // Code block C;
10 });
11 task_d = sched
0 码力 |
84 页 |
8.82 MB
| 5 月前 3
-
unifex::static_thread_pool pool;
io_uring_context ctx;
unifex::task task = async_main({argv + 1, argc - 1},
pool, ctx);
unifex::sync_wait(std::move(task));
return 0;
}int main(int argc, char** argv) { unifex::static_thread_pool pool;
io_uring_context ctx;
unifex::task task = async_main({argv + 1, argc - 1},
pool, ctx);
unifex::sync_wait(std::move(task));
return 0;
}int main(int argc, char** argv) { unifex::static_thread_pool pool;
io_uring_context ctx;
unifex::task task = async_main({argv + 1, argc - 1},
pool, ctx);
unifex::sync_wait(std::move(task));
return 0;
}int main(int argc, char** argv) {
0 码力 |
131 页 |
907.41 KB
| 5 月前 3
-
careA typical async framework
class Task { ... }
represents a unit of background work
Task::join()
explicit call to suspend the current task
until another task completes, and returns its result
propagates uncaught exceptions
Task::detach()
allows the task to run alongside the rest of the programDetached tasks considered harmful
// don’t do this
void bad(tcp::socket& s) {
std::array asio::use_awaitable);
},
asio::detached);
}
No way to figure out task lifetime
=> no automatic object lifetime managementDetached tasks considered harmful
// don’t do
0 码力 |
103 页 |
1.98 MB
| 5 月前 3
-
understanding the general behavior only.
template struct task;
task sum(int a, int b)
{
int result = a + b;
co_return result;
}
task sum4(int a, int b, int c, int d)
{
int ab = co_await initial_suspend_awaitable_t initial_suspend_awaitable;
final_suspend_awaitable_t final_suspend_awaitable;
};
};
task sum(int a, int b) {
auto frame = make_unique<__sum_frame>(a, b);
decltype(auto) returnObject release()));
return returnObject;
}
template struct task;
task sum(int a, int b)
{
int result = a + b;
co_return result;
}
task sum4(int a, int b, int c, int d)
{
int ab = co_await
0 码力 |
120 页 |
2.20 MB
| 5 月前 3
-
I handle the Error 1298: Unknown or incorrect time zone: 'UTC' error when creating the replication task or replicating data to MySQL? · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1194 7.6.4 The start-ts timestamp of the TiCDC task is quite different from the current time. During the execution of this task, replication is in- terrupted and an error [CDC:ErrBufferReachLimit] 1197 7.7.1 How do I choose start-ts when creating a task in TiCDC? · · · · · · · · · 1197 7.7.2 Why can’t some tables be replicated when I create a task in TiCDC? · 1198 7.7.3 How do I view the state of
0 码力 |
6730 页 |
111.36 MB
| 9 月前 3
-