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

What is write-back or copy-back protocol, What is write-back or copy-back p...

What is write-back or copy-back protocol? For a write operation using this protocol during write-hit: the method is to update only the cache and to mark it as updated with an a

Define encapsulation- object oriented technology, Define Encapsulation- obj...

Define Encapsulation- object-oriented technology Encapsulation also called as information hiding, is the characteristic of separating the external aspects of an object, from t

Programming with loops and comparisons, Q. Programming with loops and compa...

Q. Programming with loops and comparisons? This segment deals with more practical illustrations employing comparison, loops and shift instructions. Simple Program Loops

What are the characteristics of digital ics, What are the characteristics o...

What are the characteristics of digital ICs used to compute their performance? Ans: Characteristics of Digital Integrated Circuits 1. Speed of operation:   The Speed o

Explain a TTL NAND gate and its operation, Give the circuit of a TTL NAND g...

Give the circuit of a TTL NAND gate and explain its operation in brief. Ans: Operation of TTL NAND Gate: Fig.(d) Demonstrates a TTL NAND gate with a totem pole output.

Handlers classification, Handler's Classification In 1977, Wolfgang Han...

Handler's Classification In 1977, Wolfgang Handler proposed an detailed notation for expressing the parallelism and pipelining of computers. Handler's classification addresses

Find out the hexadecimal sum, Find the hex sum of (93) 16 + (DE) 16 ? Ans...

Find the hex sum of (93) 16 + (DE) 16 ? Ans. Hex Sum of (93) 16 + (DE) 16 Convert Hexadecimal numbers 93 and DE to there binary equivalent demonstrated below:- Hence (9

What are the steps in executing the program, What are the steps in executin...

What are the steps in executing the program? 1.Fetch 2.Decode 3.Execute 4.Store

Describe the advantages of java servlets over cgi interface, Describe the a...

Describe the advantages of JAVA servlets over CGI interface. The Advantage of Servlets Over "Tradi tional" CGI: Java servlets are extra efficient, easier to utilize more pow

Bangla numeral recognition using multilayer feed forward, Assignment 4: Han...

Assignment 4: Handwritten Bangla Numeral Recognition using Multilayer Feed Forward Neural Network. In this assignment, you will design a multi layer feed forward neural network

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