Messages in this thread | | | Date | Wed, 16 Oct 2002 11:15:50 -0700 | From | John Gardiner Myers <> | Subject | Re: [PATCH] async poll for 2.5 |
| |
Davide Libenzi wrote:
>I knew you were going there, aka you do not understand how edge triggered >API have to be used. > Nonsense.
>Even if the API will drop an event at registration >time you still cannot use this code scheme : > >int my_io(...) { > > if (event_wait(...)) > do_io(...); > >} > >You CAN NOT. And look, it is not an API problem, it's your problem that >you want to use the API like a poll()-like API. > You have insufficient basis upon which to claim I would write code as broken as above.
>This because you have to consume the I/O space to push the level to 0 so >that a transaction 0->1 can happen and you can happily receive your >events. > > Of course you have to consume the I/O space to push the level to 0. What do you think I am, stupid?
This is done with something like:
for (;;) { fd = event_wait(...); while (do_io(fd) != EAGAIN); }
Trying to do at once as much work as one can on a given fd helps keep that fd's context information in cache. If one needs to have the fd yield the CPU in order to reduce system latency, one generates a user-mode event.
[unhandled content-type:application/x-pkcs7-signature] | |