4 ms·
How many CPU cores can said "bytecode" utilize at a time? Does it make a difference between value and reference types for optimal performance?
by CmonDev 13y ago
How many CPU cores can said "bytecode" utilize at a time? Does it make a difference between value and reference types for optimal performance?
- kevingadd 13y agoasm.js doesn't have support for reference types. You can access threads via the HTML5 'Web Worker' feature.
- CmonDev 13y agoSo, all the C++ threading code will automatically be converted to 'Web Workers'?
- flohofwoe 13y agoNo, but it's not a great deal to write a parallel execution subsystem in C/C++ which abstracts the differences between pthreads and WebWorkers away. Using low-level pthreads primitives directly in high-level code is a bad idea anyway.
- flohofwoe 13y agoasm.js code is just numbers and functions, no JS "objects". Passing a C++ object by reference resolves to passing a pointer just like in native code (a pointer in emscripten-generated code is actually an index into the typed-array representing the heap). A nice side-effect of this is that asm.js code doesn't trigger the garbage collector.