Skip to content

consider implementing v8::Platform on top of libuv instead of using the default platform #12980

Closed
@jeisinger

Description

@jeisinger

currently node.js just blocks if there are pending tasks on libuv's message loop before exiting, however, with e.g. WebAssembly's async compile API, it might be the case that there's ongoing work on one of v8::Platform's background threads, and eventually in the future, a task will be posted to the foreground thread to resolve the promise for the compilation.

If node.js would implement its own version of v8::Platform instead of relying on the default platform shipped with v8, it would have visibility into the number of on-going tasks, and could wait for the promise to resolve before exiting.

From a cursory look, posting tasks to the main loop of libuv would be easy. I didn't see a way to post delayed tasks? Also, node.js would have to implement its own worker pool.

There's no need to implement idle tasks, the platform can just indicate that it doesn't support idle tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.v8 engineIssues and PRs related to the V8 dependency.v8 platformIssues and PRs related to Node's v8::Platform implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions