On Mon, 2007-04-09 at 10:56 +1000, skaller wrote:
> On Sun, 2007-04-08 at 11:27 -0700, Erick Tryzelaar wrote:
> > skaller wrote:
> > > OK, I see two options here:
> > >
> > > A. Modify the stream typeclass so all stream I/O requires
> > > a job_queue argument.
> > >
> > > B. Make a new type
> > >
> > >   afd_t = fd_t * job_queue

Well this is all a mess. So here's another option.
We make do with at most one aio queue.

In the async_hooker, which is the top level async request
manager, we add, for posix only:

    worker_fifo *aio_queue; // initialised to 0

and a method, for all os:

   worker_fifo *get_aio_queue();

On systems not needing an aio queue, this bugs out, but the
method exists. On Posix, it creates the pool if it doesn't
exist, then returns it, so the pool isn't created unless it
is required dynamically.

Now, the interface used to start a job is:

  finote_t *fn = new wakeup_fthread_t(get_ready_queue(),ft);
  dreq->start_async_op(*get_demuxer(),fn);

which I propose to change to:

  dreq->start_async_op(this,fn);

that is, the method:

    virtual bool 
    flx_driver_request_base::start_async_op_impl(
     demux::demuxer& demux
    ) = 0;

is changed to:

    virtual bool 
    flx_driver_request_base::start_async_op_impl(
     async_hooker*
    ) = 0;

so that the client operation can call

        hooker->get_demuxer()

to get the socket notification service, and

  hooker->get_aio_queue()

to get the aio queue. The object called 'async_hooker' is then
roughly a user space operating system object which provides
multiple services to 'patch up' deficiencies in the underlying
OS, or reabstract them etc..

this is kind of messy, because the abstraction now has explicit
references to the demuxer (socket notification service) and the
aio job queue. Job queues are generic, socket notification services
aren't.  The existing abstraction:

class ASYNC_EXTERN async_hooker {
public:
  virtual flx::rtl::fthread_t *dequeue()=0;
  virtual void handle_request(void *data, flx::rtl::fthread_t *ss)=0;
  virtual ~async_hooker();
};

has no such references. Still the existing interface is already broken
because it passes a 'demux' object, which is only used for socket
notifications .. 

Still thinking ..


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to