They are using Web Workers, and that means you also need the 
SharedArrayBuffers from Firefox Nightly to make this work. This is not 
supported (yet) in Google Chrome AFAIK.

On Tuesday, September 8, 2015 at 10:46:17 PM UTC-4, awt wrote:
>
> Thanks for the reply. Do you know if threads are emulated using webworkers 
> or setTimeout in Emscripten?
>
> On Tuesday, September 8, 2015 at 11:38:54 PM UTC+8, Robert Goulet wrote:
>>
>> pthread implementation on its own in Emscripten seems to be working fine 
>> so far. The only problem we have for the moment is we can't use it with 
>> WebGL (Firefox Nightly). It produces an assert about the SharedArrayBuffer 
>> type not being a correct type argument for some GL calls.
>>
>> On Tuesday, September 8, 2015 at 10:00:03 AM UTC-4, Floh wrote:
>>>
>>> These used to be empty placeholder functions so that code would at least 
>>> compile and link.
>>>
>>> However, there *is* work going on to enable pthreads-style 
>>> shared-memory-multithreading in emscripten and Firefox, see here: 
>>>
>>>
>>> https://blog.mozilla.org/javascript/2015/02/26/the-path-to-parallel-javascript/
>>>
>>> and here:
>>>
>>> https://groups.google.com/forum/#!topic/emscripten-discuss/gQQRjajQ6iY
>>>
>>> Unfortunately I didn't get around to try this out yet.
>>>
>>> Cheers,
>>> -Floh
>>>
>>> Am Dienstag, 8. September 2015 12:18:30 UTC+2 schrieb awt:
>>>>
>>>> Hi,
>>>>
>>>> I was just going thru the source when I noticed the presence of mutex 
>>>> in emscripten 
>>>> <https://github.com/kripken/emscripten/tree/b3efd9328f940034e1cab45af23bf29541e0d8ff>
>>>> /system 
>>>> <https://github.com/kripken/emscripten/tree/b3efd9328f940034e1cab45af23bf29541e0d8ff/system>
>>>> /include/libcxx/mutex and pthreads in emscripten 
>>>> <https://github.com/kripken/emscripten/tree/667dcd241886fdb878e248d95d8e03abb09c80b7>
>>>> /system 
>>>> <https://github.com/kripken/emscripten/tree/667dcd241886fdb878e248d95d8e03abb09c80b7/system>
>>>> /include 
>>>> <https://github.com/kripken/emscripten/tree/667dcd241886fdb878e248d95d8e03abb09c80b7/system/include>
>>>> /libc 
>>>> <https://github.com/kripken/emscripten/tree/667dcd241886fdb878e248d95d8e03abb09c80b7/system/include/libc>
>>>> /pthread.h. Since the browser is single-threaded, may I know how do we 
>>>> implement mutexes and pthreads under the hoods? Do we really implement 
>>>> synchronization in a multi-threading context? Is this supported only in 
>>>> FireFox Nightly or in Chrome as well? Thanks.
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to