Hacker News new | ask | show | jobs
by captaincrowbar 4238 days 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.

4 comments

You 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'.
It already does - just run your code in webworker. I am doing it at 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..

According to this document Jukka Jylänki is working on it: https://docs.google.com/spreadsheets/d/t3AwIGGaM-4Z9UZM2jpF6...
Oooh - how did you come across that? I had an idea for a way to do this https://groups.google.com/forum/#!searchin/emscripten-discus...
This is because of how JavaScript is implemented, you can't use threads in JS like you can in a C++ program.