---
title: "Comment by Jeff Tillwick on \"Introduction to Web Workers in React: A Beginner's Guide\" | Hashnode"
description: "I&#39;d like to know why the shared worker uses .port and the external worker does not. What is the logic there?"
url: "https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15/comment/64792cfb68c73be8bfc3feb6"
---

[Discussion](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15)

Comment [Introduction to Web Workers in React: A Beginner's Guide](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15)

[Jeff Tillwick](https://hashnode.com/@somewhatlazy)

[Jun 1, 2023](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15/comment/64792cfb68c73be8bfc3feb6)

I'd like to know why the shared worker uses .port and the external worker does not. What is the logic there?

[Jay Desai](https://hashnode.com/@desaijay)

[Dec 1, 2024](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15/comment/64792cfb68c73be8bfc3feb6#reply-674bfaf446e962fbd0a04ed6)

Shared workers use .port because they support multiple clients (scripts or tabs) and each connection requires a unique MessagePort for bidirectional communication. The MessagePort allows the worker to distinguish messages from different clients. Dedicated workers, on the other hand, are tied to a single client, so they don't need .port. Communication with a dedicated worker happens directly through the Worker instance.
