Title: [122631] trunk/Tools
Revision
122631
Author
[email protected]
Date
2012-07-13 14:16:39 -0700 (Fri, 13 Jul 2012)

Log Message

webkitpy: hide yield_to_caller from callers in MessagePool :)
https://bugs.webkit.org/show_bug.cgi?id=91269

Reviewed by Adam Barth.

yield_to_caller() was an optimization/hack to allow us to run
both manager and worker in a single process/loop without
starving the manager while the worker is running tests. The
worker was required to call yield_to_caller() periodically. It
turns out that I can get equivalent responsiveness by yielding
inside the MessagePool every time the worker posts a message, and this
allows me to no longer need the worker to call the routine. Thus
I rename yield_to_caller() to _yield_to_manager() to be a little
clearer about its purpose.

Tested by existing tests.

* Scripts/webkitpy/common/message_pool.py:
(_Worker.run):
(_Worker.post):
(_Worker._yield_to_manager):
* Scripts/webkitpy/layout_tests/controllers/worker.py:
(Worker.handle):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (122630 => 122631)


--- trunk/Tools/ChangeLog	2012-07-13 21:10:37 UTC (rev 122630)
+++ trunk/Tools/ChangeLog	2012-07-13 21:16:39 UTC (rev 122631)
@@ -1,3 +1,29 @@
+2012-07-13  Dirk Pranke  <[email protected]>
+
+        webkitpy: hide yield_to_caller from callers in MessagePool :)
+        https://bugs.webkit.org/show_bug.cgi?id=91269
+
+        Reviewed by Adam Barth.
+
+        yield_to_caller() was an optimization/hack to allow us to run
+        both manager and worker in a single process/loop without
+        starving the manager while the worker is running tests. The
+        worker was required to call yield_to_caller() periodically. It
+        turns out that I can get equivalent responsiveness by yielding
+        inside the MessagePool every time the worker posts a message, and this
+        allows me to no longer need the worker to call the routine. Thus
+        I rename yield_to_caller() to _yield_to_manager() to be a little
+        clearer about its purpose.
+
+        Tested by existing tests.
+
+        * Scripts/webkitpy/common/message_pool.py:
+        (_Worker.run):
+        (_Worker.post):
+        (_Worker._yield_to_manager):
+        * Scripts/webkitpy/layout_tests/controllers/worker.py:
+        (Worker.handle):
+
 2012-07-13  Adam Barth  <[email protected]>
 
         EWSTools should be able to build a commit-queue instance from scratch

Modified: trunk/Tools/Scripts/webkitpy/common/message_pool.py (122630 => 122631)


--- trunk/Tools/Scripts/webkitpy/common/message_pool.py	2012-07-13 21:10:37 UTC (rev 122630)
+++ trunk/Tools/Scripts/webkitpy/common/message_pool.py	2012-07-13 21:16:39 UTC (rev 122631)
@@ -242,7 +242,7 @@
                 message = self._messages_to_worker.get()
                 if message.from_user:
                     worker.handle(message.name, message.src, *message.args)
-                    self.yield_to_caller()
+                    self._yield_to_manager()
                 else:
                     assert message.name == 'stop', 'bad message %s' % repr(message)
                     break
@@ -264,8 +264,9 @@
 
     def post(self, name, *args):
         self._post(name, args, from_user=True)
+        self._yield_to_manager()
 
-    def yield_to_caller(self):
+    def _yield_to_manager(self):
         if self._running_inline:
             self._manager._loop(block=False)
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py (122630 => 122631)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py	2012-07-13 21:10:37 UTC (rev 122630)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py	2012-07-13 21:16:39 UTC (rev 122631)
@@ -79,7 +79,6 @@
         start_time = time.time()
         for test_input in test_inputs:
             self._run_test(test_input)
-            self._caller.yield_to_caller()
         elapsed_time = time.time() - start_time
         self._caller.post('finished_test_list', test_list_name, len(test_inputs), elapsed_time)
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to