emscripten-core / emscripten-core/emscripten

Pipe read() never blocks, and poll() ignores timeouts

Open
#27,683 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I have run into serious issues that make communication between pthreads, completely off the browser or main thread, totally broken. First is that read() on a pipe that should be blocking, instead returns immediately. And second, poll ignores its timeout parameter and also returns immediately.

This has been a persistent issue that seems to be ignored:

#25759, #20615, #19447, #16704, #16047

I am creating a new issue hoping for some attention to this issue. Now that JSPI and pthreads are available, I don't think there's any reason not to implement this correctly.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the pthreads-only behavior of blocking pipe read() and poll() with JSPI enabled, then trace the read() and poll() entry points and compare the related issues #25759, #20615, #19447, #16704, and #16047. Done means pipe read() blocks as expected and poll() honors its timeout instead of returning immediately.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.