11 ms·
The limitation with Web Workers is that the main worker thread is the only one that can interact with the DOM.
by rubiquity 11y ago
The limitation with Web Workers is that the main worker thread is the only one that can interact with the DOM.
- codesushi42 11y agoWhy would you want multiple threads touching the UI? Android processes for instance only have one UI thread.
- rubiquity 11y agoUpdating is different than reading. Having concurrent reads would be a good thing.
- codesushi42 11y agoI do not see a big benefit from that. Reading from the DOM will already be fast and can be handled in one thread. And you won't have concurrent reads if another thread is writing to the DOM. I think the designers of web workers made this decision thoughtfully. Other environments like iOS and Android only have one UI thread as well.