ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hello every1,
I seed a suggesting related asychron i\o. I'm write a program which use completion ports, but wandor how avoiding loops like for(; below...
i.e I want parse proto with count in first and then computing some quantity of pieces.
how that make with aio?
but, I'm little bit confused how I can write and read meanwhile...
i.e. if I got something necessary there a_read.aio_buf, I want to write here something like reply message.
actually, I use it with socket handle.
Frankly, I would stick with normal, blocking I/O unless:
1) my application *needed* asynchronous I/O
<= In this case, the application's requirements would dictate your design
... OR ...
2) I simply wanted to learn a i/o
<= I suspect this is your case
In the case of "learning", I would suggest the following (all from Google):
The POSIX asynchronous I/O interface, which is documented in the GNU libc manual, would seem to be almost ideal for performing asynchronous I/O. After all, that's what it was designed for. But if you think that this is the case, you're in for bitter disappointment....
Quote:
The documentation in the GNU libc manual (v2.3.1) is not complete...
Quote:
But there's a much more significant problem: The POSIX AIO API is totally screwed. The people who came up with it were on drugs or something. Really. I'll go through various issues, starting with the ones that aren't so bad and ending with the rool doozies....
hm, there not contains information how avoid loops.
I've got a buffer which have a format...
number of pieces
and some quantity of pieces
how I can to receive information from everyone pieces and avoid loops usage?
i.e. usually I do..
for(p;p<quantity;p++){
I seems use `for` itn's good with aio, more over not good use superfluous loops.
usually I did it by this way, perhaps it's so funky use for loop with aio?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.