boostorg / fiber

userland threads
464 stars 108 forks source link

Launching fiber on a different thread #311

Closed beojan closed 1 year ago

beojan commented 1 year ago

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.

beojan commented 1 year ago

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.

olk commented 1 year ago

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

beojan commented 1 year ago

I'm not looking to launch fibers without a scheduler, I'm looking to launch fibers on a thread other than the one I'm launching from.

On Wed, Nov 22, 2023, 22:34 Oliver Kowalke @.***> wrote:

Closed #311 https://github.com/boostorg/fiber/issues/311 as completed.

— Reply to this email directly, view it on GitHub https://github.com/boostorg/fiber/issues/311#event-11043673625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4OENJGPTNSBNTXGT22XT3YF3U5TAVCNFSM6AAAAAA7W5ZAIGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGA2DGNRXGM3DENI . You are receiving this because you authored the thread.Message ID: @.***>