[osg-users] Building for platform without threads?
OpenSceneGraph Users
osg-users at lists.openscenegraph.org
Mon Mar 30 15:59:07 PDT 2020
The issue is actually before anything runs, it’s link-time errors (in this case, linking the compiled WebAssembly). OpenThreads uses the standard FindThreads.cmake module, which in the case of WebAssembly still finds the pthreads headers, but at link time no pthreads libraru is available so the pthreads symbols can’t be resolved.
I don’t recall if I mentioned earlier, but the multi-threaded version works just fine in multi-threaded WebAssembly. This depends on SharedArrayBuffer support in Javascript, which has been disabled in many browsers to mitigate spectre-style attacks. So I’m trying to support the single-threaded case as well to support those browsers. This is primarily on mobile platforms.
I guess to build a usable single-threaded version, what is needed is a patch to OpenThreads to ignore all pthreads headers, and effectively stub-out some of the methods. In single-threaded WebAssembly there are apparently still gcc-style internals available for atomics, so it wouldn’t be necessary to create new code for all stubs.
Kind regards,
Phil.
> On 30/03/2020, at 10:22 PM, OpenSceneGraph Users <osg-users at lists.openscenegraph.org> wrote:
>
> Hi, Phil,
>
> when you run single threaded osgViewer, you have single thread. Which
> browsers don't like that and why?
>
> Regards,
> Michael.
More information about the osg-users
mailing list