D.7. Chapter 9

Chapter 9 has two exercises.

D.7.1. Exercise 1

If you wanted to use a C++17 feature, what flag would you use when compiling your WebAssembly module, to tell Clang to use that standard?



D.7.2. Exercise 2

Test adjusting the calculate_primes logic from section 9.4 to use three threads rather than four to see how the calculation duration is impacted. Test using five threads, and place the main thread’s calculation into a pthread to see if moving all the calculations off the main thread impacts the calculation duration.

Solution for three threads

In your WebAssembly\ folder, create the Appendix D\D.7.2\source\ folder. Copy the calculate_primes.cpp file from your Chapter 9\9.4 pthreads\source\ folder to your ...

Get WebAssembly in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.