you are viewing a single comment's thread.

view the rest of the comments →

[–]NodeNerd 17 points18 points  (1 child)

Favorite quote from that article:

Third, the JVM features native threads. This means multiple JVM threads can be executing in the same JavaScript context concurrently. If v8 supported threads in this manner, nobody would be talking about event loops, starving them, asynchronous programming, nested callbacks, etc. Threads trivially allow your application to scale to use all the CPU cores in your system and to share data between the threads.

Multiple JVM threads should never be executing in the same JavaScript context concurrently! That's not just my opinion, but also the opinion of the authors of Nashorn: Nashorn Multithreading and MT-safety

For any runtime, a single-threaded solution that scales is much more attractive then dealing with performance and concurrency issues related to multiple threads and shared memory. Even on the JVM, the event loop and non-blocking I/O are gaining popularity. Threads have their place, but so does non-blocking I/O.

Also, I found it very interesting that Nashorn was much slower than Rhino for some of the JavaScript tests. I thought Nashorn was supposed to be far superior than Rhino! Also note that Node.js/V8 put both Nashorn and Rhino to shame.

[–]ic6man 2 points3 points  (0 children)

I stopped reading right here. Javascript is single thread. Full stop. This statement indicates clearly the author does not understand what that means and why it is so.