Skip to content

Feature Request: Add patterns for SharedArrayBuffer and COOP/COEP isolation #5

@webmaven

Description

@webmaven

The cookbook currently covers basic and advanced Web Worker patterns, but it lacks examples for enabling native multithreading in Pyodide.

To support native threading (pthreads) in Pyodide, the environment must be 'cross-origin isolated'. This requires specific HTTP headers:

  • Cross-Origin-Opener-Policy: same-origin
  • Cross-Origin-Embedder-Policy: require-corp

It would be very helpful to add:

  1. An example of a dev server (e.g., in conftest.py) that serves these headers.
  2. A pattern for validating that SharedArrayBuffer is active in a Playwright/Pytest test suite.
  3. Documentation on how these headers affect package loading and third-party scripts.

This is particularly relevant for high-performance serialization or parallel processing libraries using Pyodide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions