DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • How the Web Works
  • Browsers: The Engines
  • Networking & Latency
  • HTTPS & TLS Handshake
  • CDNs & Edge Computing
  • WebSockets & WebRTC
  • RESTful Architecture
  • GraphQL Architecture
  • CORS (Cross-Origin Resource Sharing)
  • Load Balancing
  • Critical Rendering Path Deep Dive
  • DOM vs. CSSOM Construction
  • The Rendering Engine: Layout, Paint, Compositing
  • JavaScript Engine: V8 Internals
  • The Event Loop: Macro vs. Micro Tasks
  • Garbage Collection
  • Browser Storage Architecture
  • Service Workers & PWAs
  • Web Workers: Multi-Threading
← From Beginner to Expert in Fundamentals of Frontend

Web Workers: Multi-Threading

15 min read
Web WorkerSharedWorkerTransferable ObjectspostMessageOffscreen Canvas

Web Workers: Heavy Computation Off the Main Thread

Web Workers run JavaScript in a background thread, preventing heavy computations from blocking the UI.

Types

  • Dedicated Worker: One worker per script. Most common.
  • Shared Worker: Shared across multiple tabs/windows.
  • Service Worker: Intercepts network requests (covered separately).

Limitations

  • No DOM access
  • Communication via postMessage (data is cloned, not shared)
  • Transferable Objects can move data without copying (ArrayBuffer)

Use Cases

  • Image/video processing
  • Complex calculations (sorting, filtering large datasets)
  • Data parsing (CSV, JSON)
  • Encryption/hashing

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.