473,609 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1262

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

Similar topics

1
3832
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 write to a SQL Server central database with multiple users accessing their local copies of the database ( using replication technology on the clients side).
2
9168
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 for those objects. In fact, all the programmer has to worry about is the total sum of objects loaded into RAM at any known point. Memory leaks are not a problem. .... So one would like to think. The reality is that delegates and event...
4
348
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: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpovrasynchronousprogrammingoverview.asp Now, I read that 'Always call EndInvoke after your asynchronous call completes'.
3
3980
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 idle time by the client as it waits for a query to execute and return a dataset. As a test, I initially wrote two versions: ' // Sequential & Synchronous Dim webobj As com.mycompany.webobject Dim ds1 As System.Data.DataSet Dim ds2 As...
17
1885
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
3807
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. I've read through what must be dozens of ways to do socket communication in C#, and it seems they all devolve into three basic options - Socket.Select, IOCP through a native interface, and Asynchronous callbacks. I'm fine using Asynchronous...
25
2082
by: Elizabeth | last post by:
Can you all give me your best recommendation(s) for books on AJAX ? Thanks ... - E -
0
1230
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 a good idea to stick to the good old sql-databases and go ahead with the same old techniques I am using all the time. Well, let's see what's available:
3
1736
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 about template programming and don't have any experience with 3rd party libraries, such as Boost. I'm looking to buy two more books that I'm hoping will help take my C++ programming to the next level. Here are some of my choices: Beyond the...
0
8557
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8512
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8203
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5504
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4007
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4066
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2517
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.