Skip to content

Commit fcb8c3c

Browse files
committed
Remove section on synchronous loading limit
sbc100 tells me that it was removed from Chrome in 2023: https://groups.google.com/a/chromium.org/g/blink-dev/c/nJw2zwaiJ2s/m/EYPgC5D3LwAJ?pli=1 Furthermore, in that thread it is stated that such a limit was never present in the first place in Firefox or Safari.
1 parent 993df23 commit fcb8c3c

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

peps/pep-0776.rst

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -347,49 +347,21 @@ In the long term, we hope to implement stack switching ``stdin`` devices, but
347347
that is out of scope for this PEP.
348348

349349

350-
Dynamic Libraries
351-
-----------------
352-
353-
Main Thread Synchronous Loading Limit
354-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355-
356-
In the main browser thread, a dynamic library can only be loaded synchronously
357-
if it is at most 4 kilobytes. This excludes most nontrivial dynamic libraries.
358-
This limit is not present in Node.js and can be avoided by using a web worker. If
359-
stack switching is available, then it is possible to make ``dlopen()`` stack
360-
switch in order to instantiate a dynamic library synchronously.
361-
362-
To avoid the synchronous loading limit, Pyodide currently preloads all dynamic
363-
libraries present in a wheel when installing the wheel (or on startup). This is
364-
a significant disadvantage with packages like SciPy that include a very large
365-
number of shared libraries that are expected to be only loaded on demand.
366-
Pyodide will implement a solution based on stack switching as it becomes more
367-
widely available in runtimes.
368-
369-
Emscripten Python only loads extension module dynamic libraries when they are
370-
imported. This approach is simpler and more efficient when it works. The web
371-
example runs in a web worker and the cli runner runs in Node so neither of these
372-
have the synchronous loading limit. We will continue with this approach in
373-
Emscripten Python.
374-
375-
In the long run, we hope to implement a stack switching ``dlopen``, but that is
376-
out of scope for this PEP.
377-
378350
Missing RPATH Support
379-
~~~~~~~~~~~~~~~~~~~~~
351+
---------------------
380352

381-
Another important limitation of the Emscripten dynamic loader is that it does
382-
not currently have RPATH support. Pyodide's present workaround is as follows:
353+
An important limitation of the Emscripten dynamic loader is that it does not
354+
currently have RPATH support. Pyodide's present workaround is as follows:
383355
``auditwheel-emscripten`` places shared library dependencies that are vendored
384356
into a package in a ``${package}.libs`` folder, following auditwheel's
385357
convention. Pyodide patches the dynamic loader to treat this ``${package}.libs``
386358
folder as if it were on the RPATH of all of the dynamic libraries in the wheel.
387359

388360
In Emscripten 4.0.5, we have updated the shared object file format, ``wasm-ld``
389361
and ``emcc`` to accept an ``-rpath`` flag. We are still working on updating the
390-
dynamic loader to respect the rpath, but we expect this will be finished in the
391-
next Emscripten release. Pyodide will then switch to using the RPATH and drop
392-
the patch on the dynamic loader.
362+
dynamic loader to respect the rpath, but we expect this will be finished soon.
363+
Pyodide will then switch to using the RPATH and drop the patch on the dynamic
364+
loader.
393365

394366
Emscripten Python currently uses the unpatched dynamic loader and so cannot load
395367
extension modules that depend on vendored dynamic libraries via DT_NEEDED.

0 commit comments

Comments
 (0)