Boost logo

Boost :

Subject: Re: [boost] [Fibers] Performance
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-01-24 07:13:43


On 01/23/2014 01:26 AM, Gavin Lambert wrote:

> I'm having trouble understanding this. A chained operation must by
> definition be one operation being called as some other operation
> completes, and can never possibly refer to operations running in parallel.

Think of the execution of chained operations as analogous to the
execution of CPU instructions.

Niall has already explained the situation where all chained operations
should be passed to the scheduler to avoid latency. This is analogous
to avoid flushing the CPU pipeline.

You can also have chained operations that are commutative, so the
scheduler can reorder them for better performance. This is analogous
to out-of-order CPU execution.

> Or each "function" is just a custom async operation. You don't request
> a function and then try to interrogate it, you just execute operations.

Can you elaborate? If I have the following event listener, how would
it look and be used with your suggestion?

   class gui_event {
   public:
     virtual void on_key(int key);
     virtual void on_help(int x, int y);
   };


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