4 Sep
2015
4 Sep
'15
7:08 p.m.
2015-09-04 21:14 GMT+02:00 Thomas Heller
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).