|
Boost : |
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2020-03-11 11:01:22
Domen Vrankar wrote:
> On Tue, Mar 10, 2020, 4:51 PM Phil Endecott via Boost <boost_at_[hidden]>
> wrote:
>> I suspect that for things like streaming compression and encryption
>> APIs, in a couple of years we'll all agree that the right way to
>> do them will be as co-routines.
>>
>
> co-routines only add overhead in cases that are processing intensive and
> run on the local CPU. they are meant for tasks where you wait for the
> result and CPU can use that thread for something else in the meantime.
Not true - think of generators, for example. You increase performance
when something has to pause in the middle - for example a compression
function that needs more input or fills its output - and the paused
state is more efficiently represented by its stack frame than by an
explicit state object.
Everyone will understand this better in a couple of years when we have
implementations to play with.
(I feel old; I've just realised that the last time I used co-routines
was with Modula-2 in about 1987!)
Regards, Phil.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk