Asking for recommendations on good generic asynchronous I/O library

Discussion in 'C++' started by alan, Jul 7, 2008.

  1. alan

    alan Guest

    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 ^^
    alan, Jul 7, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    467
  2. I_got_questions?

    asking about good books

    I_got_questions?, Jan 9, 2006, in forum: C++
    Replies:
    17
    Views:
    489
    Diego Martins
    Jan 11, 2006
  3. Regardez
    Replies:
    0
    Views:
    290
    Regardez
    Mar 22, 2007
  4. BessieBee

    OT: Asking for recommendations...

    BessieBee, Oct 23, 2008, in forum: HTML
    Replies:
    1
    Views:
    365
    Irina Rempt
    Oct 23, 2008
  5. Travis Parks

    Algorithms Library - Asking for Pointers

    Travis Parks, Sep 2, 2011, in forum: Python
    Replies:
    6
    Views:
    252
    Travis Parks
    Sep 4, 2011
Loading...

Share This Page