Web Workers chạy JavaScript trong background thread riêng biệt, không block main thread. Giao tiếp qua postMessage. Không truy cập được DOM.
Dùng cho: heavy computation (image processing, encryption, data parsing), keeping UI responsive. SharedArrayBuffer cho phép share memory giữa workers.
Web Workers run JavaScript in a separate background thread, not blocking the main thread. Communication is via postMessage. They cannot access the DOM.
Use for: heavy computation (image processing, encryption, data parsing), keeping the UI responsive. SharedArrayBuffer allows sharing memory between workers.