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@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.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/mailman.80591.1585609153.7167.osg-users-openscenegraph.org%40lists.openscenegraph.org.

Reply via email to