Subject: Re: [boost] Boost.Fiber review January 6-15
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2014-01-07 07:27:08


2014/1/7 Antony Polukhin <antoshkka_at_[hidden]>

> * Are mutexes of Boost.Fiber thread safe?
>

you can use the mutexes from bosot.fiber in a multi-threaded env
(but you have to use fibers in your code).

> * Can fibers migrate between threads?
>

yes - unit-test test_migration shows how it is done

> * Can Boost.Asio use multithreading and fibers (I wish to use fibers to
> have a clear/readable code and multithreading to use all the CPUs)? Is
> there an example of such program?
>

fibers run concurrently in one thread - if you want to use more CPUs you
have multiple choices:

1.) you assign one io_service for each CPU (fiber migration could be done
via a specific fiber-scheduler)
2.) you have one io_service and each CPU executes io_service::run() - you
have to execute the fibers in one strand
for each CPU (not tested yet)