A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Explain Threads vs Processes?

About Processes

– An ideal process abstraction is the one where it seems like an actual machine is being used.
– The modern process model is of much value since it has much to offer.
– For the programmers it has made possible to design software that can make the various computer hardware parts work together in collaboration.
– It also lets the various parts of a computational process i.e., the threads to work together in the limits of a single process framework.
– There are processes called the classic processes that also work together but on customized computational framework that is shared by others also.
– The process manager is responsible for dividing the program in to threads and taking care of their execution.
– The program is to be executed is divided or forked in to several small parts and then subjected to execution.
– This is the case in Unix.
– In the case of windows, a function creates several threads out of a process which are then executed.

Responsibilities of a Process Manager

Following are the responsibilities of the process manager:
– Defining and implementing the characteristics of the threads and the processes.
– Defining the things such as memory locations (such as address space) that can be referred to by the threads of the process.
– Managing the resources allocated to the threads and processes.
– Providing tools for creating, manipulating and implementing the threads and processes.
– Providing tools for CPU scheduling.
– Tools for allowing the threads for synchronizing their operations.
– Providing mechanisms for handling the deadlocks.
– Providing mechanisms for handling the protection issues.

About Threads

Threads can be classified in to two categories:
– Kernel threads: The execution of the threads is time multiplexed by the operating system instead of doing this with the processes. It is because of this, that when one thread is blocked, the others still the right to carry on with the execution.
– User space threads: The classic processes are implemented by the underlying operating system. On the top of the OS abstract machine runs the user space thread library which carries out the multi-programming of the threads (such as POSIX and Mach C threads.).

Comparison between Threads and Processes

Comparison #1:
– Processes are executed within the process framework. The structure of the process includes the following:

  • Program
  • Address space
  • Shared data
  • Resources
  • Process ID

Threads are the active elements and their structure consists of the following:

  • Thread ID
  • Data specific to that thread
  • Host process environment

Comparison #2:
The process abstraction is managed by the operating system. Each process makes use of the data structure called the descriptor. This descriptor consists of the following:

  • Logical state
  • Register values
  • List of the required resources
  • Type of the resources
  • Location of the resources
  • Process ID
  • Security keys
  • Parent process

The thread scheduling is handled by the NT kernel whereas the aspects of a process are handled by the NT executive.

Thread abstraction: the process manager also has the algorithms for controlling the threads. For keeping a track of the threads, the data structure called the thread descriptor is used. The following are the tasks involved with the management of the tasks:

  • Creation and destruction of the threads.
  • Allocation of the resources specific to threads.
  • Management of the thread context switching.

The thread descriptor includes the following fields:
– State
– Process
– Execution statistics
– Stack
– Resources specific to the threads
– List of related threads

Above all the differences, the states of the threads and processes are the same:
– Ready
– Running
– Blocked

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>