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
State Disadvantages of object oriented analysis design You know that OO methods only create functional models within objects. There is no place in methodology to design a compl

Discuss the basic entities of World Wide Web in brief. World Wide Web: This is a complicated client/server system in that a web client communicates along with the web ser

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

The commercially available 8-input multiplexer integrated circuit in the TTL family is ? Ans. In TTL, MUX integrated circuit is 74153.

Direct Rambus DRAM or DRDRAM (sometimes just known as Rambus DRAM or RDRAM) is a type of synchronous dynamic RAM. RDRAM was formed by Rambus inc., in the mid-1990s as a replacement

What are the applications of Electronic Data Interchange in business? The applications of Electronic Data Interchange are as given below: 1. Organisations that use EDI 2

what are the questionnaries and observation of work site for banking system?

Main Objectives: • MPLAB In-Circuit Debugger (ICD 2) functionality • ICD 2 Connection design • MPLAB ICD 2 setup with the PC and Interface board designed • I²C Protocol buses tech

Write a function that will get a variable number of input arguments: the length and width of a rectangle, and possibly also the height of a box that has this rectangle as its base.

As an XML expert you are needed to model a system for an online furniture shop. After an interview with the shop manager you have the certain information: The detail of th