Processes vs threads, Computer Engineering

Assignment Help:

One might argue that in general processes are more ?exible than threads. For one thing, they can live in two different machines, and communicate via sockets; they are easy to spawn remotely (e.g. ssh foo.cs.umass.edu "ls -l"); etc. However, using processes requires explicit com- munication and risks hackery. Threads also have their own problems: because they communicate through shared memory, they must run on the same machine and they require thread-safe code.

So even though threads are faster, they are much harder to program. In a sense, we can say that processes are far more robust than threads, since they are completely isolated from other another. Threads, on the other hand, are not that safe, since whenever one thread crashes the whole process terminates.

When comparing processes and threads, we can also analyze the cost of context switches. When- ever we need to switch between two processes, we must invalidate the TLB cache (the so-called TLB shootdown; see Section 6.2.3). Because warming up the TLB takes time, context switches for processes are slower.

On the other hand, when we switch between two threads, it is not necessary to invalidate the TLB, because all threads share the same address space, and thus have the same contents in the cache. In other words, on many operating systems, the cost of switching between threads is much smaller than the cost of switching between processes. Most large-scale systems use a mixture of processes and threads:

threads within a process on one server, communicating via a network socket to similar processes on other servers.


Related Discussions:- Processes vs threads

Software, its language base assignment

its language base assignment

What is backward compatible, A program is backward compatible if it can use...

A program is backward compatible if it can use files from an older version of itself. For a file saved in the program to be backward compatible, it must be possible to open the fil

Explain the importance of computer architecture, Explain the importance of ...

Explain the importance of computer architecture Studying the architecture implies working on machine language programs. However, this isn't practical when we design a computer

Explain the wap stack in brief, Discuss the WAP stack in brief. The pro...

Discuss the WAP stack in brief. The protocol stacks part implemented by WAP Stack for the WAP development and research platform. The protocol stack will be exploited into many

Decision tree learning for cancer diagnosis, Assignment 1: Decision tree le...

Assignment 1: Decision tree learning for cancer diagnosis In this mini-project, you will implement a decision-tree algorithm and apply it to breast cancer diagnosis. For each p

Explain can we have constant volatile variable, Const and volatile keywords...

Const and volatile keywords should not be used together due to both are opposite in nature. A variable is declared as "const" means its value is not able to be altered but if i

Generates sequence code, The basic project will have each group generate a ...

The basic project will have each group generate a sequence of 1's and 0's using  the Motorola 688HC11 board to turn ON and then turn OFF the TV set installed in ATRC 306. Each tele

The advantage of using a database management system, The advantage of using...

The advantage of using a Database Management System The advantage of using a Database Management System for a data store is that databases have mechanisms for describing data,

What are models and meta models, Model: It is a entire explanation of s...

Model: It is a entire explanation of something (i.e. system). Meta model: It shows the model elements, syntax and semantics of the notation that permits their manipulatio

Derivatives and applications of derivatives, What can you say about the exi...

What can you say about the existence of a stationary point in the interval [ 1; 3] for the function f (x) = x 2 2x 3.

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