You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement Pthread Manager Worker for synchronous thread creation
This change introduces a dedicated 'Pthread Manager' worker that acts as
an intermediary for managing the lifecycle of pthread workers.
By moving the responsibility of spawning and managing workers to a
dedicated manager worker, we enable synchronous pthread creation on the
main browser thread even when it is blocked (e.g. during a join or
futex wait). This is because the manager worker and its nested child
workers can be started by the browser independently of the main
thread's event loop.
Key changes:
- Add PTHREAD_MANAGER setting to enable this new mode.
- Update shell.js and parseTools.mjs to detect and support the manager
environment.
- Update libpthread.js to spawn the manager worker and proxy thread
creation requests to it.
- Update runtime_pthread.js with logic to handle the manager worker's
responsibilities: spawning, terminating, and relaying messages for
child pthreads.
- Ensure the manager worker is fully initialized before the main
application starts using addRunDependency.
Fixes: #18633
0 commit comments