Difference between threads and processes, Operating System

Assignment Help:

Difference between threads and processes

1. Thread is flow of implementation. Process is group of instruction which is alike to that of a program except which may be stopped and started by the OS itself.    

2. A Thread is a single sequence stream in a process but process is an execution of program and program contain set of instructions.

3.  Process is able to contain multiple threads.

4.  Threads aren't independent like process.

5.  All threads are able to access every address in the task unlike process.

6.  Threads are designed to support one another and process might or not might be assisting on one another.

7.  Different process cannot work under same memory location and they have their own individual working memory segment. Threads are able to work under same memory area even they can access any memory location.

8.  Processes have the transparency of making all the work within it orderly and as well sum up them. However threads are done for a single unit of task only and at completion their work is all over.

9.  One process is able to run on more than one thread.

10.  Process is a term used to explain the execution of a sequential program .A thread is a point of implementation within the process.

Regard as a system of process of 3 processes p0 through p2 and 4 resource types A,B,C,D. Resource kind A has 4 instances, B has 2 instances, resource C has 3 instances  and D has 1 instances. Assume that, at time T0, we have the subsequent resource-allocation state. Notice whether there is any deadlock.

 

           Current Allocation Matrix      Request Matrix     Available Vector   Existing Vector

               (C)                                      (R)                     (A)                         (E)   

                   A  B  C  D               A  B  C  D                      A  B  C  D          A  B  C  D                                                    

            P0   0   0  1  0                 2   0  0  1                   2  1   0  0            4  2   3  1                                          

            P1   2   0  0  1                 1   0  1  0                                                   

            P2   0   1  2  0                 2   1  0  0        

 

                       p2 requests 2  1  0  0

                      After p2 finishes execution   A = 2  1  0  0 +

                                                                  0  1  2  0           gives    2  2  2  0

 

                      p1 requests 1  0  1  0

                      After p1 finishes execution   A = 2  2  2  0 +

                                                                  2  0  0  1          gives    4  2  2  1

 

                      p0 requests   2  0  0  1

                      After p0 finishes execution   A = 4  2  2  1 +

                                                                    0  0  1  0                gives   4  2  3  1  

 

Thus there is no dead lock during the allocation of resources.

 


Related Discussions:- Difference between threads and processes

If a process is blocked, There is a process bloacked by a semaphore and no ...

There is a process bloacked by a semaphore and no other process in the ready queue, can the blocked process get back to the ready queue without the semsignal() function?

Explain swapping, Explain Swapping Swapping is a method of temporarily ...

Explain Swapping Swapping is a method of temporarily removing inactive programs from the memory of computer system.

Activities of an operating system, Q. What are the five main activities of ...

Q. What are the five main activities of an operating system in regard to process management? Answer: a. The creation as well as deletion of both user and system processes

How can the deadlock be prevented?, How can the deadlock be prevented? ...

How can the deadlock be prevented? To evade deadlocks first we will have to obtain the information about how resources are to be requested. And as well we should make sure that

Explain the various methods of file access, Operating Systems 1. Illust...

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

Performance of job scheduling strategies, Performance of Job Scheduling  St...

Performance of Job Scheduling  Strategies In this project you will investigate the performance of Job Scheduling strategies, Memory Allocation strategies and a CPU Scheduling s

What is the concept of an atomic operation, Question: Concurrency and Sync...

Question: Concurrency and Synchronization a) Define the following terms: I. Critical section II. Mutual Exclusion III. Deadlock IV. Starvation. b) Name three methods w

We can view an operating system as a resource allocator, We can view an ope...

We can view an operating system as a resource allocator. Explain. We can outlook an operating system as a resource allocator. A computer system has Many resources (software and

What are threads?, What are threads? A thread is alike to sequential pr...

What are threads? A thread is alike to sequential programs. Single threads have a beginning, sequence and end. At any given point in time during the runtime of the thread there

Principles of operating systems, Objective - Tiny Shell (tish) In this...

Objective - Tiny Shell (tish) In this exercise you will write a small shell program to run different programs in foreground and background mode. Background Usually when

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd