<div dir="ltr">Hi!<div><br></div><div style>I've been working in some tests to the pollers (Kqueue, Epoll ..) that may interest you guys.. My goal is to create test cases for each poller situation (ie: how to detect client disconnection with epoll and unix pipes? or tcp sockets..) and understand how all those pollers are different from each other and how we can map a generic events with all those possible underlying implementations. </div>

<div style><br></div><div style>I already  did some Epoll and Kqueue tests here: <a href="https://bitbucket.org/felipecruz/tulip/commits">https://bitbucket.org/felipecruz/tulip/commits</a></div><div style><br></div><div style>

best regards,</div><div style>Felipe Cruz</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/21 Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Dec 21, 2012 at 7:57 AM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>


> On Fri, Dec 21, 2012 at 6:31 AM, Geert Jansen <<a href="mailto:geertj@gmail.com">geertj@gmail.com</a>> wrote:<br>
</div><div class="im">>> Please find attached 4 patches:<br>
>><br>
>> 0001-run-fd-callbacks.patch<br>
>><br>
>> This patch will run callbacks for readers and writers in the same loop<br>
>> iteration as when the fd got ready. Copying from my previous email,<br>
>> this is to support the following idiom:<br>
>><br>
>>     # handle_read() sets the "ready" flag<br>
>>     loop.add_reader(fd, handle_read)<br>
>>     while not ready:<br>
>>         loop.run_once()<br>
>><br>
>> The patch currently dispatches callbacks twice in each iteration, once<br>
>> before blocking and once after. I tried to dispatch only once after<br>
>> blocking, but this made the SSL transport test hang. The reason is<br>
>> that the create_transport task is scheduled with call_soon(), and only<br>
>> when the task first runs, a file descriptor is added. So unless you<br>
>> dispatch before blocking, this task will never get started.<br>
><br>
> Interesting. Go ahead and submit.<br>
<br>
</div>Whoa! I just figured out the problem. You don't have to run the ready<br>
queue twice. You just have to set the poll timeout to 0 if there's<br>
anything in the ready queue. Please send me an updated patch before<br>
submitting.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br></div>