Changeset 122631 in webkit


Ignore:
Timestamp:
Jul 13, 2012 2:16:39 PM (12 years ago)
Author:
dpranke@chromium.org
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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r122627 r122631  
     12012-07-13  Dirk Pranke  <dpranke@chromium.org>
     2
     3        webkitpy: hide yield_to_caller from callers in MessagePool :)
     4        https://bugs.webkit.org/show_bug.cgi?id=91269
     5
     6        Reviewed by Adam Barth.
     7
     8        yield_to_caller() was an optimization/hack to allow us to run
     9        both manager and worker in a single process/loop without
     10        starving the manager while the worker is running tests. The
     11        worker was required to call yield_to_caller() periodically. It
     12        turns out that I can get equivalent responsiveness by yielding
     13        inside the MessagePool every time the worker posts a message, and this
     14        allows me to no longer need the worker to call the routine. Thus
     15        I rename yield_to_caller() to _yield_to_manager() to be a little
     16        clearer about its purpose.
     17
     18        Tested by existing tests.
     19
     20        * Scripts/webkitpy/common/message_pool.py:
     21        (_Worker.run):
     22        (_Worker.post):
     23        (_Worker._yield_to_manager):
     24        * Scripts/webkitpy/layout_tests/controllers/worker.py:
     25        (Worker.handle):
     26
    1272012-07-13  Adam Barth  <abarth@webkit.org>
    228
  • trunk/Tools/Scripts/webkitpy/common/message_pool.py

    r122618 r122631  
    243243                if message.from_user:
    244244                    worker.handle(message.name, message.src, *message.args)
    245                     self.yield_to_caller()
     245                    self._yield_to_manager()
    246246                else:
    247247                    assert message.name == 'stop', 'bad message %s' % repr(message)
     
    265265    def post(self, name, *args):
    266266        self._post(name, args, from_user=True)
    267 
    268     def yield_to_caller(self):
     267        self._yield_to_manager()
     268
     269    def _yield_to_manager(self):
    269270        if self._running_inline:
    270271            self._manager._loop(block=False)
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/worker.py

    r122384 r122631  
    8080        for test_input in test_inputs:
    8181            self._run_test(test_input)
    82             self._caller.yield_to_caller()
    8382        elapsed_time = time.time() - start_time
    8483        self._caller.post('finished_test_list', test_list_name, len(test_inputs), elapsed_time)
Note: See TracChangeset for help on using the changeset viewer.