Re:Writing a Non-Blocking JavaScript Quicksort
by exogen on Wednesday June 10, 2015 @02:00AM
(#9690325)
The polyfill implements setImmediate using postMessage in IE8, though. AFAIK it's not really possible to polyfill WebWorkers.
[ Parent
| on HN ]
Re:Writing a Non-Blocking JavaScript Quicksort
by thomasfoster96 on Wednesday June 10, 2015 @04:10AM
(#9690623)
You can sort of polyfill web workers by providing the same API but running the web worker in the main thread.
Edit: I assume I'm being downvoted because you're still running the script in the main thread, and therefore lose the concurrency. Obviously this is an issue with a polyfill, but the point of polyfilling web workers would be to keep the one codebase rather than writing your your web app with and then without web workers.
Re:Writing a Non-Blocking JavaScript Quicksort
by AgentME on Wednesday June 10, 2015 @04:32AM
(#9690675)
Which misses the point entirely. The problem the author had was doing sorting of many items in IE8 without a warning. Using a real web worker would be a solution, but using a web worker polyfill that ran in the main thread would put him right back where he started, with IE8 triggering a warning.
Re:Writing a Non-Blocking JavaScript Quicksort
by thomasfoster96 on Wednesday June 10, 2015 @05:41AM
(#9690860)
I wasn't clear enough: I'd be polyfilling web workers not for this specific problem, but for other cases where I could use web workers and not lose IE8 support.