real-time application
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? Code:
void parse(void *buf, int buflen, struct sockaddr_in sin){ |
Q: What does your "for" loop do?
If it polls for input available .... doesn't that kind of defeat the whole purpose of using "asynchronous input" in the first place? Just wondering... |
ok, that's perfect, you're understanding me;)
I mean how did it without 'for' loop's... for instance, I use synchronisation by aio_suspend... Code:
const struct aiocb *list[2] = {&a_read,NULL}; 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. |
paulsm4, how I can reply on received messages?
because standard i\o doesn't work here.... Code:
char *buf; |
Hi -
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): http://www.ibm.com/developerworks/li...brary/l-async/ http://www-aix.informatik.uni-tuebin..._io_subsys.htm http://www.informit.com/articles/art...07373&seqNum=1 and finally http://davmac.org/davpage/linux/async-io.html Quote:
Quote:
Quote:
|
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? Code:
struct piece { |
All times are GMT -5. The time now is 09:05 PM. |