Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 7th, 2008, 04:15 PM
alan
Guest
 
Posts: n/a
Default Asking for recommendations on good generic asynchronous I/O library

Hello all, I'd like to ask recommendations about a "good" generic
asynchronous I/O library for C++. By generic I mean, something I can
use even on files, stdin/stdout, and sockets.

I've seen boost::asio, and also ioxxx, but most of the examples I've
seen with them are about sockets. Can they be used for general i/o
(files, terminal)? Can anyone point me to good tutorials about using
them for stuff other than sockets?

My use case is, I have a set of worker threads in a pool executing
tasks. Every now and then a task may need to perform I/O. If so, the
worker thread initiates the I/O and pushes the task back on the queue
and dequeues a new task. If a worker thread gets a task with pending
I/O, it checks if the I/O is complete, and if it isn't requeues it and
gets a new task, if the I/O is complete is continues with that task.

The reason I'd prefer to handle this case rather than just let the OS
block a thread is when, for some reason, I can only use one worker
thread (e.g. if threads are disabled, or the target doesn't have
threads, etc.). If so the only way I have to simulate multiple tasks
running in parallel would be to use asynchronous I/O on the single
worker thread. I'd rather have the same code to handle both the
single thread case and the multi-thread one, but if there are good
arguments against that I'll reconsider it.

Portability is good, but anything on Linux is OK for me ^^
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles