Process and Threads

Understabding what exactly is meant by a process is truely important let me tell you what microsoft tells about the question what is a process?

processes
An executable program, such as Windows Explorer, or a service, such as MSTask.


Coming to the threads

threads
An object within a process that runs program instructions. Threads allow concurrent operations within a process and enable one process to run different parts of its program on different processors simultaneously.

/*

Now let me share with you my opinion a process is nothing much than a executible file. When i sat executible file and if you are using windows OS the first thing That must strike your brain any file on windows machine with .exe extension :-)

Imagine in your you are sitting and you switch on your computer you find that some have uninstalled ie browser now u have to download it and reinstall it , at present if u go to the task manager if u look for processes running on your machines u will not find ie listed since its not present on ur machine so remeber when i say process it just a an executable programme when it comes to windows its nothing much than .exe file

Now if at all u wanna have a process running on ur machine with t he name ie (internet explorer) all that u need to do is just execute the corresponding executible file

*/

Representation

In general, a computer system process consists of (or is said to 'own') the following resources:

  • An image of the executable machine code associated with a program.
  • Memory (typically some region of virtual memory); which includes the executable code, process-specific data (input and output), a call stack (to keep track of active subroutines and/or other events), and a heap to hold intermediate computation data generated during run time.
  • Operating system descriptors of resources that are allocated to the process, such as file descriptors (Unix terminology) or handles (Windows), and data sources and sinks.
  • Security attributes, such as the process owner and the process' set of permissions (allowable operations).
  • Processor state (context), such as the content of registers, physical memory addressing, etc. The state is typically stored in computer registers when the process is executing, and in memory otherwise.[2]

The operating system holds most of this information about active processes in data structures called process control blocks (PCB).

Any subset of resources, but typically at least the processor state, may be associated with each of the process' threads in operating systems that support threads or 'daughter' processes.

The operating system keeps its processes separated and allocates the resources they need so that they are less likely to interfere with each other and cause system failures (e.g., deadlock or thrashing). The operating system may also provide mechanisms for inter-process communication to enable processes to interact in safe and predictable ways.

No comments:

Post a Comment