add wrapper methods to reserve more stacks to existing schedulers

This commit is contained in:
q66 2017-03-25 15:04:28 +01:00
parent b1d95faa41
commit ed9f7c8949

View file

@ -345,6 +345,10 @@ public:
p_stacks.deallocate(st); p_stacks.deallocate(st);
} }
void reserve_stacks(size_t n) {
p_stacks.reserve(n);
}
private: private:
void dispatch() { void dispatch() {
while (!p_coros.empty()) { while (!p_coros.empty()) {
@ -508,6 +512,10 @@ public:
p_stacks.deallocate(st); p_stacks.deallocate(st);
} }
void reserve_stacks(size_t n) {
p_stacks.reserve(n);
}
private: private:
template<typename TSA, typename F, typename ...A> template<typename TSA, typename F, typename ...A>
void spawn_add(TSA &&sa, F &&func, A &&...args) { void spawn_add(TSA &&sa, F &&func, A &&...args) {