emscripten-core / emscripten-core/emscripten

pthread workers 100% CPU usage...

Open
#22,128 34 comments 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

Hello,

Today I profiled my wasm engine (pthreads version) and found that all 4 threads (workers) of the job system take 100% CPU usage.
I used chrome profiler. Normally it shows nothing in workers (white bars) if thread is suspended. But in my case it shows usage in... emscripten_futex_wait. Isn't it suppose to suspend thread (sleep) in this function? Why it shows hundreds of millisecond CPU usage in waiting for conditional variable?

![pthreads](https://github.com/emscripten-core/emscripten/assets/34769255/b77fb95a-5520-4f20-9aba-1285e24afef8)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.