Skip to content

[pthreads] Simplify message relaying code#27018

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:simplify_relay
Open

[pthreads] Simplify message relaying code#27018
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:simplify_relay

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented May 27, 2026

Historically, targetThread relaying was used to pass objectTransfer messages (containing OffscreenCanvas objects) back to parent threads on worker exit. This was introduced in commit 1b27891 (2018/2019) and required supporting transferList in the relaying code.

However, automatic canvas return on exit was later disabled in 6dcf729 (2019) and the objectTransfer command was fully removed in 0f536c6 (2021).

These days, the relaying mechanism is only used by CMD_CHECK_MAILBOX (via _emscripten_notify_mailbox_postmessage) to send simple mailbox notifications, which do not require a transfer list.

@sbc100 sbc100 requested review from kripken and tlively May 27, 2026 22:36
Historically, `targetThread` relaying was used to pass `objectTransfer`
messages (containing `OffscreenCanvas` objects) back to parent threads
on worker exit. This was introduced in commit 1b27891 (2018/2019)
and required supporting `transferList` in the relaying code.

However, automatic canvas return on exit was later disabled in
6dcf729 (2019) and the `objectTransfer` command was fully removed
in 0f536c6 (2021).

These days, the relaying mechanism is only used by `CMD_CHECK_MAILBOX`
(via `_emscripten_notify_mailbox_postmessage`) to send simple mailbox
notifications, which do not require a transfer list.
@sbc100 sbc100 enabled auto-merge (squash) May 27, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant