Sunday, February 24, 2013

Task, Program, Process, and Thread


Hi Readers,

This post is purely technical and operating system related so, please be aware.  If you don't like technical so just leave. Well I have seen people getting confused between these four terms related to operating system. So, let me clarify this doubt by sharing my knowledge and concept. You will not find any strong definition here, I would just explain you the concept. So these terms are Task, Program, Process and Thread. The hierarchy goes like this below diagram



A Task is a set of Program loaded in memory.

A Program is a Passive entity that is its like a group of process residing in secondary storage.

A Process is a part of Program currently in execution.

A Thread is much more smaller division of this Process.

Task/Process/Thread are active entity that means they are loaded in primary memory where as Program is a Passive entity which is in secondary memory. Therefore at most places you won't find any details on these four at the same time.

Lets take an example- When you open applications they form tasks that is to say that you opened MS word, windows media player, and some other application. Now when these individual applications like MS word was not opened it was like program residing in secondary storage. Once you open MS word it gets loaded to RAM and forms a process. So the question comes where is thread, the thread is like smaller entity in this process that is when you write something on MS word you would see spell checker showing errors, so these spell checkers are like Threads.

So to summarize you can say that a Process and Program are more over the same thing only difference is that one is term for application in primary memory and the other for application in secondary storage. (Note:- Application in previous sentence refers to any executable code). So the diagram to explain all the stuff above is as below-



I hope that this post clarifies your concept. Please come up with any question regarding this. I will surely try to solve that.

Thanks
Nakul

No comments:

Post a Comment