Re: [LAD] Inter thread Communication: Design Approach

From: Paul Davis <paul@email-addr-hidden>
Date: Thu Sep 01 2011 - 23:36:14 EEST

On Thu, Sep 1, 2011 at 4:33 PM, David Robillard <d@email-addr-hidden> wrote:
> On Thu, 2011-09-01 at 15:54 -0400, Paul Davis wrote:
>> On Thu, Sep 1, 2011 at 2:37 PM, Fons Adriaensen <fons@email-addr-hidden> wrote:
>>
>> > That's assuming that the event's virtual execute() has access to
>> > all it needs. In all cases I've encountered that is not the case:
>> > the event triggers something in the context where it is received
>> > and processing it requires access to that context's data.
>> > It's a problem for which I don't know a clean C++ solution.
>>
>> depending on the exact type of thing you're talking about, isn't this
>> is place for closures, functors, etc. etc. ?
>
> The event pretty much is a glorified closure, but, alas, the multiple
> contexts of execution complicate it so you have to manually store what
> are actually the 'parameters' and such so you can do the work later.
>
> In less primitive languages you might be able to do something nice with
> actual closures and continuations, but... oh well.

the execute member can be a functor rather than a virtual function, for example.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Sep 2 00:15:02 2011

This archive was generated by hypermail 2.1.8 : Fri Sep 02 2011 - 00:15:03 EEST