close
Skip to content

N-API documentation incorectly states napi_create_async_work is not multithreaded #19071

@ebickle

Description

@ebickle
  • Version: 9.7.0
  • Platform: Windows 7, Build 7601: Service Pack 1, 64-bit.
  • Subsystem: Documentation / N-API

The N-API documentation for the Custom Asynchronous Operations (https://nodejs.org/api/n-api.html#n_api_custom_asynchronous_operations) incorrectly states that napi_create_async_work (Simple Asynchronous Operations) executes on the main event loop.

This is incorrect; simple asynchronous operations execute from the Node.js Worker Thread Pool. People who read the documentation may make the dangerous assumption that asynchronous work queued via N-API will never execute in parallel with the main event loop.

I've implemented my own simple test on 64-bit Windows 7 using the N-API Simple Asynchronous Operations and verified that Execute is called from a separate thread-id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions