Question

In: Computer Science

Explain the difference between concurrency and parallelism. Using these concepts, discuss how a multi-threaded application can...

Explain the difference between concurrency and parallelism. Using these concepts, discuss how a multi-threaded application can run faster than a single-threaded application on a single-processor machine and on a multi-processor machine.

Solutions

Expert Solution

First Part:

The differences between concurrency and parallelism are the following:

Concurrency Parallelism
(i) It can be performed using a single CPU. (i) It can be performed using only multiple CPUs.
(ii) It can be defined as the process of executing and managing multiple operations at the same time. (ii) It can be defined as the process of executing multiple operations at the same time.
(iii) It can be performed based on context switching. (iii) It can be performed using multiple processors.
(iv) It increases the system throughput (number of tasks completed per unit time). (iv) It increases the system throughput and processing speed.
(v) It manages multiple operations simultaneously. (v) It performs multiple operations simultaneously.
(vi) It is non-deterministic control flow approach. (vi) It is deterministic control flow approach.
(vii) Debugging is more difficult. (vii) Debugging is less difficult.

Second Part:

Multi-threaded application can be defined as the program which have multiple threads (light-weight process) and they can be executed in the same address space. As it can have a higher degree of parallelism than a single-threaded application, so the execution speed will be faster.

In the multi-processor system, the multi-threaded application will run faster than a single-threaded application as it can have a higher degree of both concurrency and parallelism. Also, the execution will be faster than a single processor machine as the single processor machine can only achieve concurrency using context switching, but it will not be able to achieve parallelism.

Please comment in case of any doubt.
Please upvote if this helps.


Related Solutions

Create a Java application that will exhibit concurrency concepts. Your application should create two threads that will act as counters.
JAVACreate a Java application that will exhibit concurrency concepts. Your application should create two threads that will act as counters. One thread should count up to 20. Once thread one reaches 20, then a second thread should be used to count down to 0.
Create a C++ application that will exhibit concurrency concepts. Your application should create two threads that will act as counters.
C++Create a C++ application that will exhibit concurrency concepts. Your application should create two threads that will act as counters. One thread should count up to 20. Once thread one reaches 20, then a second thread should be used to count down to 0.
Create a C++ application that will exhibit concurrency concepts. Your application should create two threads that will act as counters.
C++ application:Create a C++ application that will exhibit concurrency concepts. Your application should create two threads that will act as counters. One thread should count up to 20. Once thread one reaches 20, then a second thread should be used to count down to 0.For your created code, provide a written analysis of appropriate concepts that could impact your application.Please Specifically, Address: Performance Issues with Concurrency Vulnerabilities Exhibited with use of Strings and Security of the Data Types used.
essay question: Discuss the difference between covered and uncovered interest parity and explain both concepts
essay question: Discuss the difference between covered and uncovered interest parity and explain both concepts
Questions1: Discuss, in detail, the difference(s) between the concepts of international marketing and domestic marketing. Explain,...
Questions1: Discuss, in detail, the difference(s) between the concepts of international marketing and domestic marketing. Explain, briefly, why and how would multinationals firms adapt their products to foreign markets. Support your answer with related example [LO1] [ [15 Marks]
Using the concepts from the Concurrency Basics Tutorial I provided in Modules, write a program that...
Using the concepts from the Concurrency Basics Tutorial I provided in Modules, write a program that consists of two threads. The first is the main thread that every Java application has. The main thread should create a new thread from the Runnable object, MessageLoop, and wait for it to finish. If the MessageLoop thread takes too long to finish, the main thread should interrupt it. Use a variable named maxWaitTime to store the maximum number of seconds to wait. The...
Explain the key difference between a web service application and a general client/server application
Explain the key difference between a web service application and a general client/server application
C# Programming Discuss how to build a Multi-Form Windows application in C#. That is an App...
C# Programming Discuss how to build a Multi-Form Windows application in C#. That is an App that has more than one form, like say maybe 5 forms. How do you connect these forms and pass data objects between these forms?
How can I explain the difference between quantitative and qualitative methods?
How can I explain the difference between quantitative and qualitative methods?
What type of application programs are not suitable for multi-threading? Explain.
What type of application programs are not suitable for multi-threading? Explain.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT