Processes vs threads, Computer Engineering

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.

Posted Date: 3/12/2013 4:17:35 AM | Location : United States







Related Discussions:- Processes vs threads, Assignment Help, Ask Question on Processes vs threads, Get Answer, Expert's Help, Processes vs threads Discussions

Write discussion on Processes vs threads
Your posts are moderated
Related Questions
How would you implement inheritance using VB.NET/C#? When we set out to execute a class using inheritance, we must first start with an existing class from which we will derive

Does the use of wire-center have any influence on the performance of a token ring? Explain. One problem along with a ring network is as if the cable breaks somewhere, the ring

This assignment consists of design and development of an information system. The first part of the assignment consists of the design, which includes construction of ER and DFD diag

What is Central Processing Unit Central Processing Unit (CPU) performs all the arithmetic and logical calculations in a computer. The CPU is said to be the brain of the compute

Q. Explain about 4-bit adder-subtractor circuit? Subtraction operation on binary numbers can be obtained by succession of addition operations only it implies that to achieve su

What is MASK OPERATION The mask operation is similar to selective-clear operation except which the bits of Aare cleared only where there are corresponding 0's in register B. th

Design a circuit for determining the 9's compliment of a BCD number by using 4-bit binary adder and some external logic gates? Compliment of a BCD number 9's co

Q. Executing a parallel algorithm? Multiple processors need synchronization with one another when executing a parallel algorithm. So task which is running on processor X may ha

Problem: (a) Accessibility can be classified as below: (i) Barrier-free design (ii) Web accessibility. Describe the importance of barrier free design and web accessibi

Q. Analysts in Telecommunications area? Here computer networks which play a critical role in success of any business are designed, implemented and managed. Here Network analyst