3 ms·
This looked like great news until I came to "Heavy use of threads is also going to be a problem since Emscripten doesn't currently support them." Sorry, this i
by captaincrowbar 12y ago
This looked like great news until I came to "Heavy use of threads is also going to be a problem since Emscripten doesn't currently support them."
Sorry, this is a total showstopper for me. I'll check back when Emscripten actually lets me use more than 1/4 or 1/8 of the CPU.
- AlexeyBrin 12y agoThis is because of how JavaScript is implemented, you can't use threads in JS like you can in a C++ program.
- bobajeff 12y agoAccording to this document Jukka Jylänki is working on it: https://docs.google.com/spreadsheets/d/t3AwIGGaM-4Z9UZM2jpF6KA/htmlview?pli=1#gid=0 https://docs.google.com/spreadsheets/d/t3AwIGGaM-4Z9UZM2jpF6...
- marcosscriven 12y agoOooh - how did you come across that? I had an idea for a way to do this https://groups.google.com/forum/#!searchin/emscripten-discuss/marcosscriven/emscripten-discuss/gjjJcCF-Tz8/d1BtJjUuKOgJ https://groups.google.com/forum/#!searchin/emscripten-discus...
- hippich 12y agoIt already does - just run your code in webworker. I am doing it at https://hashcash.io/ https://hashcash.io/ Detection of number of available cores is totally different problem. On the other hand, probably detecting number of cores should not be used in first place..
- marcosscriven 12y agoYou can use the other core, but you have to think of them a little like separate machines. They can't share memory, but you can pass messages between them very fast (using JS's underlying Trasferale Objects) If you can use bump/frame allocators those 'messages' can be whole chunks of 'memory'.