Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-10-30 13:56:57


I watched the talk Herb Sutter gave recently regarding concurrency, and
I have to say I find the ideas of active objects and future variables to
be very exciting. (A link to the talk is provided below, which must be
viewed with Internet Explorer). I noticed that Boost already has a
futures library in the sandbox under development, which from what I can
tell looks well designed. Are there any plans to add the functionality
of active objects to boost as well? I would be interested in hearing
how you think the problem would be best approached.

 From what I can tell, it should ideally be possible to use 'active' as
a modifier like 'const' or 'volatile' in front of a specific object
instance, and have all member function calls automatically add
themselves to a queue when called, instead of actually being called.
Because this syntax is probably impossible to pull off, I think the next
best thing would look something like the following:

struct MyClass
{
    int foo ( int arg1, const char * arg2 );
};

void test ( )
{
    active < MyClass > object;
    future < int > i = object.request ( MyClass::foo, 42, "blah" );
}

'request' could also be spelled 'enqueue', 'invoke', or 'operator ()',
although I'm not sure if the terseness of the latter would be sensible.
'active' would probably use CRTP to derive privately from 'MyClass',
enforcing that member functions of MyClass are not called directly.
Thoughts?

Herb Sutter's video:
http://microsoft.sitestream.com/PDC05/TLN/TLN309_files/Default.htm#nopreload=1&autostart=1

-Jason


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