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
Bidirectional Search: We've concentrated so far on the searches where the point of view for the search is to find a solution, but not the path to the solution. Like any other

How sensors uses in real time process control Sensors send data (through an analogue to digital converter - ADC) to a microprocessor or computer that decides whether or not to

The output of a logic gate is 1 when all its inputs are at logic 0. The gate is either ? Ans. When all inputs of logic gate at logic 0 and output is 0. The gate is either a NOR

How can i made Carnot engine

sir, please give me an source code program for Hierarchial-Directory-system using any Unix/Linux

Explain Language Processor Development Tools (LPDTs) through schematic diagram. LPDT that is Language processor development tools focuses upon generation of the analysis phase

Q. Explain about Combinational Circuits? Combinational Circuit is one of the models for parallel computers. In interconnection networks, different processors correspond with ea

How are devices represented in UNIX? All devices are shown by files called special files that are located in /dev directory. Therefore, device files and other files are named a

Not at this time. With GIMP based on GEGL, so that all changes are non-destructive, it will be much easier to execute this feature by just remembering all nodes in given range and

Explain the term - ancestors The ancestors of modern age computer were mechanical and electro-mechanical instruments. This ancestry can be traced as back and seventeenth centur