On Wed, 11 Mar 2020 at 05:02, Phil Endecott via Boost
Domen Vrankar wrote:
On Tue, Mar 10, 2020, 4:51 PM Phil Endecott via Boost < boost@lists.boost.org> 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!)
Luckily, we are now all using Modern C++ now (when the implementations will finally arrive, that is). I know nothing, but did Modula-2 have modules, maybe? I remember I was running the OS for a little while, also in the 80's. degski -- @systemdeg "We value your privacy, click here!" Sod off! - degski "Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding "Growth for the sake of growth is the ideology of the cancer cell" - Edward P. Abbey