Wednesday, March 28, 2012

Processes and Threads

The process concept helps to explain, understand and organize execution of programs in an OS. A process is an execution of a program. The emphasis on 'an' implies that several processes may represent executions of the same program. this situation arises when several executions of a program are initiated, each with its own data, and when a program that is coded using concurrent programming techniques is in execution.

A programmer uses processes to achieve executin of programs in a sequential or concurrent manner as desired. An OS uses processes to organize execution of programs. Use of the process concept enables an OS to execute both sequential and concurrent programs equally easily.

The process is a central concept of the operating system. A wide range of processes have been initiated defnisi. Simply put, the process is an executable program. The process is the smallest unit of work that an individual has the resources and resource-scheduled operating system. The operating system manages all the processes in the system and allocate resources to the process as needed.

A thread is an execution of a program that uses the environment of a process, that is, its code, data and resources. If many threads use the environment of the same process, they share its code, data and resources. An OS uses this fact to reduce its overhead while swiching betwen such threads.
 
Process models discussed so far have shown that a process is a program that runs a single thread of execution. For example, if a process running a word processor program, there is a single thread of instructions that are being implemented.
 

 Single thread of control only allows processes to run one task at a time. Many modern operating systems already have a concept developed in order to allow a process to have multithreads execution, in order to be able to continuously type in a character and run the spelling checker in the same process. Then the operating system allows processes to run more than one task at a time

No comments:

Post a Comment