lkml.org 
[lkml]   [2002]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.220 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site