lkml.org 
[lkml]   [2003]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: debate on 700 threads vs asynchronous code
Mark Hahn wrote:
>>>>>does epoll provide a thunk (callback and state variable) as well as the
>>>>>IO completion status?
>>>>
>>>>No. It provides an event record containing a user-defined state pointer
>>>>plus the IO readiness status change (different from IO completion status).
>>>>But that's what you need; you can do the call yourself.
>>>
>>>well, that means another syscall, which makes a footprint claim kind of moot,
>>>no?
>>
>>What syscall? You call sys_epoll once for every thousand events or so,
>>then you call your handler, which does a write or whatever. No
>>extra syscall.
>
> before a client can be sent the next chunk, the IO status of the last
> chunk must be tested. with the simple blocking, thread-per-client approach,
> this happens automaticaly (write returns the number of bytes written).
>
> with epoll, don't you have to do a syscall to query the status of
> the just-completed IO?

Nope. Just go ahead and write. (Same as with poll(), except that
with epoll, you only get notified once.) Any errors are reported
immediately by write(), so there's no more status to get.
- Dan


--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.036 / U:3.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site