Boost logo

Boost :

From: Casey Bodley (cbodley_at_[hidden])
Date: 2021-11-29 18:11:36


On Sun, Nov 28, 2021 at 1:50 AM Oliver Kowalke via Boost
<boost_at_[hidden]> wrote:
>
> Hi,
> I'd like to propose the new library boost.spawn (https://olk.github.io/)
> for review.
> boost.asio's boost::asio::spawn() uses the deprecated and inefficient
> boost.coroutine library.
> boost.spawn provides the same functionality while using boost.context's
> fiber directly.
>
>
>
> Oliver
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

thanks for proposing this, Oliver!

as a satisfied user, i'd like to express my support. the Ceph project
has been maintaining a fork of this work at
https://github.com/ceph/spawn/, and it's been running in production
for nearly 2 years now in our Ceph Object Gateway [1] component

for us, the crucial feature of this fork is its ability to customize
the StackAllocator. the original boost::asio::spawn() offers limited
customization through boost::coroutines::attributes [2], but that only
covers the stack size and unwind behavior. Oliver's fork allows you to
pass in any object meeting the requirements of boost::context's
StackAllocator concept [3], and the context library provides several
options here. you can read a bit more about our use case in the "rgw:
coroutine stack protection" thread [4] on the Ceph development mailing
list

another minor feature that this adds over boost::asio::spawn() is
support for completion handlers with more than one non-error-code
argument. for example, when a handler's signature is (error_code, int,
std::string), the async initiating function will return those
non-error-code values as a std::tuple<int, std::string>

[1] https://docs.ceph.com/en/pacific/radosgw/
[2] https://www.boost.org/doc/libs/1_77_0/libs/coroutine/doc/html/coroutine/attributes.html
[3] https://www.boost.org/doc/libs/1_77_0/libs/context/doc/html/context/stack.html
[4] https://www.spinics.net/lists/dev-ceph/msg00704.html


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk