summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-04-23 12:59:33 (GMT)
committerGitHub <noreply@github.com>2022-04-23 12:59:33 (GMT)
commit92c1037afc28d9d22e43b275c5e8fae41729ec1c (patch)
treef82012ad15f553a8331fe6772eaa93420986ac3f /Tools
parent130a8c386bc1a8de49eadf784fa178869ce01f37 (diff)
downloadcpython-92c1037afc28d9d22e43b275c5e8fae41729ec1c.zip
cpython-92c1037afc28d9d22e43b275c5e8fae41729ec1c.tar.gz
cpython-92c1037afc28d9d22e43b275c5e8fae41729ec1c.tar.bz2
gh-84461: Add --enable-wasm-pthreads and more file systems (GH-91820)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/wasm/README.md25
1 files changed, 15 insertions, 10 deletions
diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md
index 9d3680a..83806f0 100644
--- a/Tools/wasm/README.md
+++ b/Tools/wasm/README.md
@@ -121,18 +121,27 @@ functions.
- The ``select`` module is limited. ``select.select()`` crashes the runtime
due to lack of exectfd support.
-## processes, threads, signals
+## processes, signals
- Processes are not supported. System calls like fork, popen, and subprocess
fail with ``ENOSYS`` or ``ENOSUP``.
- Signal support is limited. ``signal.alarm``, ``itimer``, ``sigaction``
are not available or do not work correctly. ``SIGTERM`` exits the runtime.
- Keyboard interrupt (CTRL+C) handling is not implemented yet.
-- Browser builds cannot start new threads. Node's web workers consume
- extra file descriptors.
- Resource-related functions like ``os.nice`` and most functions of the
``resource`` module are not available.
+## threading
+
+- Threading is disabled by default. The ``configure`` option
+ ``--enable-wasm-pthreads`` adds compiler flag ``-pthread`` and
+ linker flags ``-sUSE_PTHREADS -sPROXY_TO_PTHREAD``.
+- pthread support requires WASM threads and SharedArrayBuffer (bulk memory).
+ The Node.JS runtime keeps a pool of web workers around. Each web worker
+ uses several file descriptors (eventfd, epoll, pipe).
+- It's not advised to enable threading when building for browsers or with
+ dynamic linking support; there are performance and stability issues.
+
## file system
- Most user, group, and permission related function and modules are not
@@ -173,20 +182,16 @@ functions.
distutils, multiprocessing, dbm, tests and similar modules
are not shipped. All other modules are bundled as pre-compiled
``pyc`` files.
-- Threading is disabled.
- In-memory file system (MEMFS) is not persistent and limited.
- Test modules are disabled by default. Use ``--enable-test-modules`` build
test modules like ``_testcapi``.
## wasm32-emscripten in node
-Node builds use ``NODERAWFS``, ``USE_PTHREADS`` and ``PROXY_TO_PTHREAD``
-linker options.
+Node builds use ``NODERAWFS``.
-- Node RawFS allows direct access to the host file system.
-- pthread support requires WASM threads and SharedArrayBuffer (bulk memory).
- The runtime keeps a pool of web workers around. Each web worker uses
- several file descriptors (eventfd, epoll, pipe).
+- Node RawFS allows direct access to the host file system without need to
+ perform ``FS.mount()`` call.
# Hosting Python WASM builds