Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-09-07 09:09:50


On 9/7/05, Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]> wrote:
>
> On 9/6/05, Christopher Kohlhoff <chris_at_[hidden]> wrote:
> > My only suggestion at this time is that rather than trying to
> > reimplement all the demuxer code (for doing dispatch(), post() etc),
> > just use the task_demuxer_service and implement the aio code as a task.
> > A task must have the following interface:
> >
> > class Task
> > {
> > public:
> > void reset(); // Reset in preparation for a new run() call.
> > void run(); // Perform operations until interrupted.
> > void interrupt(); // Stop an existing run loop.
> > };
> >
> > Note that the interrupt() function must be able to be called from a
> > different thread to run().
> >
> > You then use your demuxer like so:
> >
> > typedef basic_demuxer<
> > detail::task_demuxer_service<detail::aio_task> > aio_demuxer;
>
> I think I missed this part of the code, now that I looked better I'm
> certain this is the best way to do it.
> Could you give me a rationale of the Task concept name?

Perhaps the active object (ACE_Task) in ACE? The asio Task doesn't have a
message queue like the ACE one, but it is otherwise similar.

-- 
Caleb Epstein
caleb dot epstein at gmail dot com

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