Hello, I would like to receive help with this problem. It is actually a question
ID: 661587 • Letter: H
Question
Hello, I would like to receive help with this problem. It is actually a question from a textbook, but I dont feel that the chegg answer for this question is correct So I am hoping to get help from experts.
You can find the chegg solution for this problem here:
http://www.chegg.com/homework-help/operating-system-concepts-9th-edition-chapter-4-problem-14e-solution-9781118063330
A system with two dual-core processors has four processors available for scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is performed just before the program terminates, when the program results must be written to a single file. Between startup and termination, the program is entirely CPU bound. Your task is to improve the performance of this application by multithreading it. The application runs on a system that uses the one-to-one threading model (each user thread maps to a kernel thread).
Explanation / Answer
One-to-One Thread Modelling:
The one-to-one model is used to map each user thread to the kernel thread.
It allows multiple threads to run on multiprocessors in parallel.
Given the system uses dual core processors. So, it consists of two processors on a single chip.
The design of a dual-core processor chip allows, running at a lower clock speed, to outperform (for many applications).
Multithreading increases the concurrency because the threads execute parallel saving time and save memory.
Number of threads for input and output:
The count of the threads for input and output is one for each processor.
As the system has two processors, two threads can run concurrently on two processors.
The reason behind requirement of one thread for input and output operation is one-one thread model and one-one model maps each user thread to the kernel thread.
Thus, the output will be generated after mapping the user thread to the kernel thread.
Thus, the numbers of threads required are 2 for both processors.
Thread count for CPU-intensive application:
The thread count depends on priority and requirements of application.
It also depends upon number of processors for execution.
It requires 4 threads when the operations are performed separately.
As parallelism of multithreading can be performed on a system the number of threads required are either 2 (when input and output operations are performed on single thread on both processors) or 4 (two threads one for input and one for output for each processor).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.