Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: multi-isolate support for NodePlatform #16700

Closed
wants to merge 2 commits into from

Commits on Nov 2, 2017

  1. src: prepare v8 platform for multi-isolate support

    This splits the task queue used for asynchronous tasks scheduled
    by V8 in per-isolate queues, so that multiple threads can be supported.
    
    PR-URL: ayojs/ayo#89
    Reviewed-By: Timothy Gu <timothygu99@gmail.com>
    addaleax committed Nov 2, 2017
    Configuration menu
    Copy the full SHA
    e65b6ae View commit details
    Browse the repository at this point in the history
  2. src: cancel pending delayed platform tasks on exit

    Worker threads need an event loop without active libuv handles in
    order to shut down. One source of handles that was previously
    not accounted for were delayed V8 tasks; these create timers
    that would be standing in the way of clearing the event loop.
    
    To solve this, keep track of the scheduled tasks in a list
    and close their timer handles before the corresponding isolate/loop
    is removed from the platform.
    
    It is not clear from the V8 documentation what the expectation is
    with respect to pending background tasks at the end of the
    isolate lifetime; however, an alternative approach of executing
    these scheduled tasks when flushing them led to an infinite loop
    of tasks scheduling each other; so it seems safe to assume that
    the behaviour implemented in this patch is at least acceptable.
    
    PR-URL: ayojs/ayo#120
    Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
    addaleax committed Nov 2, 2017
    Configuration menu
    Copy the full SHA
    ca75a4c View commit details
    Browse the repository at this point in the history