Processes vs threads, Computer Engineering

Assignment Help:

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.


Related Discussions:- Processes vs threads

Manipulating logical expressions, Digital circuits also manipulate logicale...

Digital circuits also manipulate logicalexpressione.g. IF account is in credit THEN allow phoneto make calls.So a digital circuit must determine if somethingis TRUE or FALSE. Norma

What is the demand of mobile application developers, Desktop based IT appli...

Desktop based IT application is present but the mobile is future. All the applications that were made to work only on counter top are being ported to mobile. In the coming 10 years

Explain time sharing operating system, Explain Time sharing operating syste...

Explain Time sharing operating system. Time sharing: It is also called as multi tasking, is a logical execution of multiprogramming. Multiple jobs are executed through the C

Why do we call motherboard a motherboard, Motherboard is called as motherbo...

Motherboard is called as motherboard because in the world all borned creature is directly attached to her mother & after it all the relations makes due to her mother so in the simi

What is a modem, What is a Modem? Modems are fundamentally used to int...

What is a Modem? Modems are fundamentally used to interface digital circuits to transmit information on analogue channels as telephone systems. Modem is from modulator-demodul

Explain high level data link control, Explain High Level Data Link Control....

Explain High Level Data Link Control. HDLC - it is High Level Data Link Control: Protocol Overall explanation: Layer 2 of the OSI model is the data link layer. One of the

State the scope of security policy, State the scope of security policy ...

State the scope of security policy The scope of security policy depends on aspects such as the size of the Intranet site, type of information hosted on it, and the number of u

What is the window of the working set of a process, What is the window of t...

What is the window of the working set of a process? The window of the working set of a method is the total number in which the method had referred the set of pages in the work

Communication of request/response - procedural interaction, Explain the Com...

Explain the Communications of Request/Response Communications requirements for message or procedural- based interaction are very similar. Application interaction (client-server

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd