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
Retina - Biometric Computer Security Systems The next security technology that explained in this report is retina security technology which is very famous in a lot of spy movi

Program Level This is usually the dependability of the operating system, which runs processes simultaneously. Different programs are evidently independent of each other. So par

Electric typewriter : Electric typewriters are similar to standard typewriters but with an electronic motor taking the place of human energy. It is much faster than the standard m

Give your analysis for the following problem statement: You require to write a program that calculates the area and perimeter of a rectangle whose dimensions (Length &width) are gi

Demonstrate how a typical DMA controller can be interfaced to an 8086/8085 based maximum mode system.  For 8088 in maximum mode: The RQ/GT0 and RQ/GT1 pins are used to is

Automatic typewriter : It is a power-driven machine, which automatically types a standard pro forma from a previously punched or stencilled master. When the master is placed on th

Simplify the given expressions using Boolean postulates Y = (A + B)(A‾ + C)(B + C) Ans. Y = (A + B)(A‾ + C)(B + C) = (A A‾ + AC + B A‾ + BC) (B + C) = (AC + B A‾ + BC) (B + C)

Explain various classes of datatypes of C   Following are the main classes of data types in C language: 1.  Primary data types: Also called as fundamental/basic data types

Researching strategy - artificial intelligence: If our search and researching strategy and swot of it is surety to find all types of hints such the solutions eventually, then

1. How can you divide the screen into quadrants? Is the process called as ‘viewing transformations’?