Boost logo

Boost :

Subject: Re: [boost] Boost.Fiber mini-review September 4-13
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2015-09-04 15:08:48


2015-09-04 21:14 GMT+02:00 Thomas Heller <thom.heller_at_[hidden]>:

Could you please elaborate a bit why non-allocating futures wouldn't
> require a mutex? Or more generally, a execution context suspension/yield
> mechanism?
>

I mean no std::mutex (pthread_mutex) is required.
a protocol, utilizing atomics, between future and promise does the job -
http://blog.forecode.com/2012/05/23/a-non-allocating-stdfuturepromise/
in 'void promise::set_value(R && r)' boost::this_fiber::yield() could be
used, if the future is not ready yet (e.g. AS(future->state, 0, 'R') fails).


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