Re: [PATCH] async poll for 2.5

From: John Gardiner Myers (jgmyers@netscape.com)
Date: Wed Oct 16 2002 - 13:15:50 EST


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.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Oct 23 2002 - 22:00:29 EST