boostorg / fiber

userland threads

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Launching fiber on a different thread

beojan opened this issue · comments

I'd like to launch fibers on a pool of worker threads, but not the main thread. Currently, I'm using shared_work scheduler in all the threads, launching fibers with launch::post and simply not calling this_thread::yield from the main thread in the hope that the fibers will just get scheduled on one of the workers (which are waiting on a condition variable). However, it seems with this setup my fibers never run at all.

Turns out I was actually trying to launch from a thread where I hadn't set the scheduler. Nevertheless, it would be nice to be able to launch fibers on other threads.

Unfortunately you always need a scheduler, it is not possible to use fibers without a scheduler.