News for hackers. Stuff that matters.
Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by magicalist on Sunday May 31, 2015 @04:39PM (#9635451)
It gets ugly fast. Most tasks are not a simple sort. There's a reason that cooperative multitasking is not widely used in operating systems anymore.
Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by eueueu on Sunday May 31, 2015 @05:58PM (#9635733)
Javascript is not an operating system.

There aren't many operations in javascript which will block. The only real issue is that your javascript code executes in the same thread as UI. Which just means you need to think a bit harder about keeping it responsive.

"Start threads!" in programming is usually a lazy hack.

Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by LnxPrgr3 on Sunday May 31, 2015 @07:16PM (#9635981)
Lazy hack, or using OS/browser/whatever features instead of reinventing them poorly?

What's the benefit you get from programming like that?

Re:Demonstrating Web Worker: Sorting a 50K array in your bro... by eueueu on Monday June 01, 2015 @10:37AM (#9638855)
Because once you introduce threads, your program complexity increases massively. You're now throwing a few groups of instructions at the CPU and saying "Hay! Execute these instructions in any order you like". Then you're adding code to deal with the issues of that random execution entails.

Also, it's not faster, so what's the actual point?

The browser should use all CPU cores efficiently to make javascript fast. Exposing WebWorkers to javascript programmers IMHO is totally the wrong way to do that.