Threads vs IP Address vs Ports

What is a thread

Threads are units of execution on a CPU. Multithreading is when the CPU uses two or more threads at once.

Imagine a thread is like a hose, and your task like a pool. If you only use one hose to fill up the pool it will take a long time, now if you use multiple hoses the task of filling up the pool would be reduced significantly.

What is an IP address

An IP address (Internet Protocol Address) is a computer's way of telling other devices on the network its location. All devices connected to an internet connection have one or more IP addresses.

Whenever you send a request on the internet, say you want to go to a website, that request together with your IP address is sent to the IP address of the website you want to open.

After receiving the request, the website would then send the website data back to your IP address which was attached to the request that you sent.

Once the request arrives at your IP address, it then needs to enter the correct port.

What is a port

A port is a place where network connections start and end. Ports are software-based and managed by a computer's operating system.

Ports allow computers to separate traffic, emails go on one port and web pages on another, even though both use the same network connection.

What's the difference between a thread and a port

A thread and a port are completely different, a thread is a unit, while a port is a place.

It would be like comparing a hose and a seaport.