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
What are the different sections of a report? A report is categorized into many sections: The Report header: In this you place a control which must appear only at the startin

What is 1 00 line exchange with one two-motion selector per subscriber. Design: In, Strowger switching system is designed by using one two-motion selector for all subscrib

Q. Library of functions of parallel virtual machine? PVM offers a library of functions libpvm3.a, that application programmer calls. Every function has some specific effect in

Smart Card & E-Cash E-cash storable smart cards can kept and dispense cash electronically, making bills and coins lesser essential. It transfers funds over phone lines, making

Q. Explain how does CPU perform Read and Write operation on peripheral device taking suitable example in case of Asynchronous Technique. Differentiate Memory mapped and Isolated

Driver software is software that works as a translator among another program and some piece of hardware. In the software industry, there are commonly standard ways to do things. Th

Write a BASH/C shell script which takes a name of a directory as a command line argument, and prints unique login name of the users having files in that directory. Your code should

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Differentiate the latch and flip-flop? The major difference between latch and FF is which latches is level sensitive whereas FF is edge sensitive. They both need the use of clo

This is a huge collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and difficult arithmetic, to more sophisticated functions like matri