Boost logo

Boost :

From: Matthew Vogt (mvogt_at_[hidden])
Date: 2004-02-19 22:46:03


scott <scottw <at> qbik.com> writes:

> only one item of feedback really. think that i follow your
> machinery and can envisage the "model of execution" - its
> pretty slick. its also somewhat different to the pattern
>

Really? I think it corresponds fairly closely to the pattern described
in the paper by Lavender and Schmidt; it's a limited form of the *potential*
pattern, in that it enforces a single execution thread for the active
object. More complicated schemes could certainly be created, but not
without creating constraints on the type to be wrapped. The reference paper
describes the use of a single thread...

> this does seem to be a class/framework for (very convenient)
> arrangement of concurrent method execution. which piece of
> the ActiveObject pattern does this map to?
>

Like this:
the proxy functors map to the 'Proxy' objects,
the detail::task_descriptor objects map to the 'Method Request' objects,
the boost::thread member of the active<> wrapper maps to the 'Scheduler' object
the detail::task_queue of the active<> wrapper maps to the 'Activation Queue'
  object
the wrapped object maps to the 'Servant' object
the future objects map to the 'Future' objects

Assuming I've followed the paper correctly, of course.

> i s'pose anything declared in the private scope of "object"
> is thread safe?
>

No, only methods which are explicitly wrapped in 'proxy' functors are safe,
but I suppose any access to the object's private details from the active<>
wrapper's internal thread would be safe; also, the wrapped object is private
to the wrapper and not accessible to clients.

Matt


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