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 "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
Given the subsequent FIFO and rules, how deep does the FIFO require to be to stop underflow or overflow? RULES: a. frequency(clk_A) = frequency(clk_B) / 4 b. per

E-brokerage. An e-brokerage is an investment house that permits you to buy and sell stocks and get investment information from its Web site.

What is booting? When the power is turned on, the OS has to be loaded into the main memory which is taken place as part of a process known as booting. To initiate booting a tin

Function of an IP Packet Screening Router: A screening router is the most basic type of firewall and uses only the packet filtering capability to control and monitor network tr

Representations/Languages Used: Many people are taught "AI" with the opening line: "The three most important things in "AI" are  representation, representation and representat

(a) What is Grid computing? (b) What are the key distinctions between conventional distributed computing and Grid computing? (b) Describe how five features of Grid Computi

Multi-Layer Artificial Neural Networks - Artificial intelligence: Now we can look at more sophisticated ANNs, which are known multi-layer artificial neural networks because the

Explain the Reference Count The system relates a reference count along with each memory area to point out the number of its active users. This number is incremented while a us

Translator for low level programming language were called as    Assembler

Describe the essential properties of the Real Time operating systems. Real time operating system has following essential properties: Time constraint result Priority