Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
IOLoop wake up trick
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tudor Golubenco  
View profile  
 More options Sep 23 2009, 5:42 am
From: Tudor Golubenco <tudo...@gmail.com>
Date: Wed, 23 Sep 2009 11:42:18 +0200
Local: Wed, Sep 23 2009 5:42 am
Subject: IOLoop wake up trick
Hi,

I was reading through the ioloop.py code and found nice the code that wakes
up the poll when it needs to stop the server. It works by sending a
character into pipe
which has one end in the poll list. However, shouldn't this fd be
registered to the READ
event instead of the WRITE event?

Like:

diff --git a/tornado/ioloop.py b/tornado/ioloop.py
index 6c4b727..15ef0b9 100644
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -94,7 +94,7 @@ class IOLoop(object):
         self._set_nonblocking(w)
         self._waker_reader = os.fdopen(r, "r", 0)
         self._waker_writer = os.fdopen(w, "w", 0)
-        self.add_handler(r, self._read_waker, self.WRITE)
+        self.add_handler(r, self._read_waker, self.READ)

     @classmethod
     def instance(cls):

This is a really tiny issue because the poll timeout is set to 0.2
seconds anyway, but
wanted to point it out to make sure I understand it correctly.

Best Regards,
Tudor

--
Tudor Golubenco                 http://golubenco.org

Beware of bugs in the above code; I have only proved it correct,
not tried it.  -- Donald Knuth


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mayfield  
View profile  
 More options Oct 13 2009, 3:29 pm
From: mayfield <too...@gmail.com>
Date: Tue, 13 Oct 2009 12:29:29 -0700 (PDT)
Local: Tues, Oct 13 2009 3:29 pm
Subject: Re: IOLoop wake up trick
On NetBSD this change was actually necessary to make the webserver
function.

On Sep 23, 3:42 am, Tudor Golubenco <tudo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »