Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
WASM with thread support not working on Google Chrome iOS

I have some threaded (pthread) & non-threaded WASM processes running perfectly in several versions of Google Chrome in Android, Mac OS X, Windows, etc across different machines.

I was lucky enough to get hands on an iPhone13 for testing (iOS 15.3, Chrome 97.0.4692.84). Cross Origin isolation is enabled and SharedArrayBuffer, which is needed for threaded WASM, is supported in this iOS version (https://caniuse.com/sharedarraybuffer).

Unfortunately the WASM code does not run and it stops on the first call to WASM from Javascript.

If i disable USE_PTHREADS on the emscripten compilation then the non threaded WASM works but obviously the threaded one doesn't.

My compilation is done using:

emcc -std=c++11 -O3 -s ALLOW_MEMORY_GROWTH=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s EXPORTED_RUNTIME_METHODS='["getValue"]' -s test.cpp -o test.js

Do you have any insight on why (Chrome) on iOS is failing even though there is support for things to run properly? I have some feedback of other people that claim threaded WASM running on iOS so any insight would be helpful.

I can provided barebones/example code if necessary.

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just in case someone hits this issue:

-s ALLOW_MEMORY_GROWTH=1 is the root cause of the issue. For things to work in iOS Safari/Chrome then this flag needs to be disabled -s ALLOW_MEMORY_GROWTH=0

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!