Boost logo

Boost :

From: Hurd, Matthew (hurdm_at_[hidden])
Date: 2004-02-16 23:06:40


> On Behalf Of Matthew Vogt
> Allowing the use of asynchronous I/O seems to break the abstraction,
which
> leaves me wondering why the object should be active? (This is in the
> context
> of *local* objects, BTW - if the object is remote there is very little
> difference between a client/server solution and one using active
objects,
> is
> there?)
>
> Apologies in advance if I'm not getting something obvious...
>
> Matt
>

I think you're confusing the reference to asynch i/o I made, or I'm
confused. Recent form would suggest the latter ;-)

I was suggesting that a future value is a bit like asynch i/o. I meant
that in the sense that with asynch i/o you request something get on with
your life and react to it later.

A future works like this too, but a little more indirectly, your future
is your handler mechanism. You call your function/method which returns
a future, say boost::future< double >. When you go to use your future
if the value is not yet available then it blocks waiting until it is.
If it is available then you use it.

This would fit with an active object pattern where the method call
returns a result quite nicely, especially if futures where compatible
with triggering results on to the queues of other active objects.
Though I think the asynch design approach is superior in performance,
the semantics of a synchronous approach are often clearer as it looks
like a traditional serial program.

This would lead to a cute pattern that I haven't seen or thought of
before where you get a future value from an active object, but call a
method on another active object with that future value ad infinitum and
the results just percolate through. :-) Sounds neat but a little
impractical I think. The traditional call a method on the Active object
and have the results percolate through the pre-allocated workflow of
queues and active objects makes a lot more sense.

Regards,

Matt Hurd
_______________________

Susquehanna Pacific P/L
hurdm_at_[hidden]
+61.2.8226.5029
_______________________

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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