473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 ^^
Jul 7 '08 #1
0 1242

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: nospam | last post by:
Hello - Anyone have any thoughts on which API to use - ADO or ODBC? I have a fat client written in C++ using MFC ODBC classes to access a Jet database. The app is going to be modified to...
2
by: Jon Davis | last post by:
The garbage handler in the .NET framework is handy. When objects fall out of scope, they are automatically destroyed, and the programmer doesn't have to worry about deallocating the memory space...
4
by: bernardpace | last post by:
Hi, I am trying to get more familiar with asynchronous programming. I was reading through the document found on the page: ...
3
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of...
17
by: I_got_questions? | last post by:
I just started c programming. I want to migrate to c++. I know a little bit about class/inheritance. I am asking for good books to read. Elementary will be good. Thanks for any comments
4
by: taskswap | last post by:
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. ...
25
by: Elizabeth | last post by:
Can you all give me your best recommendation(s) for books on AJAX ? Thanks ... - E -
0
by: kleinhans | last post by:
Hi netters, I am used in MYSQL + PHP. Sometimes POSTGRESQL + PYTHON/ZOPE was used. Now I have to build a bibliography system that stores a lot of XML-Files and I am not quite sure wether it is...
3
by: Carl Youngblood | last post by:
I own the 3rd edition of Stroustrup's THE C++ PROGRAMMING LANGUAGE and have read most of it, but I find its style to be more suitable for reference than for tutorial. I still have a lot to learn...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.