What does “threads” and “handles” in my PC’s task manager mean?

1.24K views

Whenever I open the task manager on my PC to check the status a few terms confuse me. I know what CPU, memory usage, and GHz mean, but I don’t understand “threads” and “handles”. I’ve searched online, but the explanations are too complicated. Can anyone help clear this up?

In: Technology

2 Answers

Anonymous 0 Comments

A process is an instance of a computer program that is running on a computer. Processes are executed by units of work called threads. A process can have multiple threads.

A function of the operating system is to schedule threads. You see, you have only so many cores, so many execution units in your hardware, and if you’re running Windows, you can have hundreds or thousands of threads. So what has to happen is each thread gets a time slice in a core. The scheduler is responsible for getting threads into and out of a core for its time slice, in some orderly fashion. So a more technical definition for a thread is the smallest unit of work handled by the scheduler.

A handle is an abstract reference to a resource. A resource is any physical or virtual component of your computing environment with limited availability. Memory is a resource, and memory addresses are actually just handles. A mutex is a synchronization mechanism between different processes sharing a resource – for example, if you’re sharing memory, then you want to be sure that you don’t write over what some other process is in the middle of reading. When you open a file, you get a file handle referring to that open resource.

Often, from a program’s perspective, a handle is just some integer, the system enumerates resources. That handle refers to some internal table of data, some program state, that is managed by the operating system – that the resource is in use, and how.

You are viewing 1 out of 2 answers, click here to view all answers.