Question

In: Computer Science

In operating systems: Why might threads be particularly useful in writing an application such as a...

In operating systems:

Why might threads be particularly useful in writing an application such as a web browser with multiple tabs?

Solutions

Expert Solution

1) Thread:

i) A thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.

ii) A thread is a basic unit of CPU utilisation, consisting of a program counter , a stack and a set of registers.(and thread ID).

iii) Traditional (heavyweight) processes have a single thread of control.i.e. one program counter, one sequence of instructions.

2) Multiple Threads

​​​​​​i) Single process executes using multiple threads, each having their own program counter, stack and set of registers, but sharing common code, data, and certain structures such as open files.

ii)Above points are shown diagrametically below:

3) Threads are very useful in modern programming whenever a process has multiple tasks to perform independently of the others.

4) When one of the task may block, and it is desired to allow other tasks to proceed without blocking.

5) M​​​ultiple threading is useful in the application like web browser with multiple tabs because, Multiple threads allow for the multiple requests to be satisfied simultaneously, without having to service request sequentially or to fork off separate processes for every incoming request.

6) Following diagram shows the architecture of multithreaded server.

7) Responsiveness is one of the benefit of using multi threading.Due to responsiveness one thread may provide rapid response while otjer threads are blocked or slowed down doing intensive calculations.

8)Creating and managing threds is much faster than performing the same tasks for processes.

9) Multi threaded application may be split amongst available processors.


Related Solutions

Threads: Assume a multithreaded application using user level threads mapped to a single kernel level thread...
Threads: Assume a multithreaded application using user level threads mapped to a single kernel level thread in one process (Many to one model). Describe the details of what happens when a thread (i.e. thread 1) executes a blocking system call (5 points). Describe what happens when thread 1 yields control to another user level thread, namely thread 2, in the same process. (NOTE: include the following in your description: what state is saved?, where is it saved? What state is...
1.) Describe an application of linear programming that you might find useful where you work, in...
1.) Describe an application of linear programming that you might find useful where you work, in a course you are taking or in your personal life. Be specific with your answers. This is an opportunity for you to showcase what you have learned about linear programming and your ability to apply your knowledge to real-world applications. A comment such as "I do not use linear programming" will earn no credit. Do not write something general such as "I could use...
Create a simple C++ application that will exhibit concurrencyconcepts. Your application should create two threads...
Create a simple 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 detailed analysis of appropriate concepts that could impact your application. Specifically, address:Performance issues with concurrencyVulnerabilities exhibited with use of stringsSecurity of the data types exhibited.
Describe an application of linear programming you might find useful where you work, in your personal...
Describe an application of linear programming you might find useful where you work, in your personal life or in a course you are taking. You will receive no credit for responses such as "There is no application where I work or in my personal life." In your post, demonstrate that you understand the goals of linear programming and how it can be applied in "the real world."
How is the balance sheet used to record amortization and why might it be useful as...
How is the balance sheet used to record amortization and why might it be useful as coupon payments are made?
What is a hypothesis and why might a hypothesis test be useful in deciding whether to...
What is a hypothesis and why might a hypothesis test be useful in deciding whether to launch a new product or not? Give a business example to support the reasoning.
Why might a meta-algorithmic (or hybrid) approach to storing signals or images have a particularly high...
Why might a meta-algorithmic (or hybrid) approach to storing signals or images have a particularly high percent improvement (please provide an example)
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT