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
a luminous jewel game c programming start with t and end with t the output will yes or no

Conversioin of the decimal number 82.67 into Octal number ? Ans. The binary equivalent is (1010010.10101011) 2 of decimal number 82.67. After that convert each 3-bit binary in

Q. Explain Point-to-point Message Passing? In point to point message passing, one process transmits/receives message from/to another process. There are four communication modes

How is network examined by intranets, extranets and Internet? When more and more businesses seek to build their mission critical business solutions onto IP networks, networking

Stack is a portion of RAM used for saving the content of Program Counter and common purpose registers. LIFO stacks, also called as "push down" stacks, are the conceptually easi

Q. Explain Open-systems interconnections architecture model The most common network architecture model is the open-systems interconnections (OSI). Figure shows the ISO (Intern


What are batch systems?  Batch systems are quite appropriate for implementing large jobs that need little interaction. The user can submit jobs and return later for the results

c-program for the minimum total number of shelves

Ground substitution: Here the act of performing an instantiation is a function like there is only one possible outcome means we can write it as a function. And the notation Su