Re:Porting to Emscripten
by marcosscriven on Wednesday November 05, 2014 @03:50PM
(#8564162)
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...
Re:Porting to Emscripten
by marcosscriven on Wednesday November 05, 2014 @03:52PM
(#8564172)
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...
Re:Porting to Emscripten
by AlexeyBrin on Tuesday November 04, 2014 @10:58PM
(#8560460)
This is because of how JavaScript is implemented, you can't use threads in JS like you can in a C++ program.
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.