|
Boost : |
Subject: [boost] custom async devices
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2009-10-07 04:46:02
Recently I had a question about how I could use
asio for performing asynchroneous file IO.
In the meantime I found that there are already some
classes for doing async_read_at IO on handles,
but only for windows. Since I need to address multiple
platforms I am wondering how I would go about
that.
I am thinking of an emulation layer in user-space
based on threads.
I guess I could set up a thread-pool that will
accept async call ins. The thread pool would
know about an io_service and when a task, e.g.
a file IO has completed, use the post function
on the io_service to invoke the completion handler.
Is this a reasonable design?
Any pros/cons?
Does anyone know of an example that I could use
as a starter?
Thank you,
Roland
-- _________________________________________ _ _ | Roland Schwarz aka. speedsnail |_)(_ | sip:speedsnail_at_[hidden] | \__) | mailto:roland.schwarz_at_[hidden] ________| http://www.blackspace.at
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk