Question

In: Computer Science

As described in Section 4.5.2, Linux does not distinguish between processes and threads. Instead, Linux treats...

As described in Section 4.5.2, Linux does not distinguish between processes and threads. Instead, Linux treats both in the same way, allowing a task to be more akin to a process or a thread depending on the set of flags passed to the clone() system call. However, many operating systems — such as Windows XP and Solaris — treat processes and threads differently. Typically, such systems use a notation wherein the data structure for a process contains pointers to the separate threads belonging to the process.

Contrast these two approaches for modeling processes and threads within the kernel. Consider a multiprocessor system and a multithreaded program written using the many-to-many threading model. Let the number of user-level threads in the program be more than the number of processors in the system. Discuss the performance implications of the following scenarios.

Solutions

Expert Solution

On one hand, in systems whereprocesses and threads are considered as similar entities, some of the operating system codecould be simplified. A scheduler, for instance, can consider the different processes and threadsin equal footing without requiring special code to examine the threads associated with aprocess during every scheduling step. On the other hand, this uniformity could make it harderto impose process-wide resource constraints in a direct manner. Instead, some extra complexity is required to identify which threads correspond to which process and perform therelevant accounting tasks.

And if we are considering a multiprocessor system and a multithreaded program written using the many-to-many threading model. Let the number of user-level threads in the program be more than the number of processors in the system. Discuss the performance implications of the following scenarios:

a. The number of kernel threads allocated to the program is less than the number of processors. The scheduler can only schedule user level processes to the kernel threads, and since some of the processes are not mapped to the kernel threads, they will be idle.

b. The number of kernel threads allocated to the program is greater than the number of processors but less than the number of user-level threads. All of the processes will be working simultaneously assuming there are enough user threads. If a kernel thread is blocked, it may be swapped out for one that isn’t blocked.


Related Solutions

Discuss the differences between processes and threads. Include discussion of the limitations of both multiple processes...
Discuss the differences between processes and threads. Include discussion of the limitations of both multiple processes and multiple threads, and give examples as to when you might want to use them.
Distinguish between homogeneous and heterogeneous reactions. Which ones are described by boundary conditions and which ones...
Distinguish between homogeneous and heterogeneous reactions. Which ones are described by boundary conditions and which ones manifest themselves in the differential equations
Distinguish between top-down and bottom-up processes In perception. Making explicit reference to several of the pain...
Distinguish between top-down and bottom-up processes In perception. Making explicit reference to several of the pain management techniques.
How does Mead distinguish between the body and the self? How is the self both a...
How does Mead distinguish between the body and the self? How is the self both a subject and an object? How is the ability to assume the "role of the other" so vital to being human? What does Cooley mean by "the looking glass self" and how does it relate to the social self?
1. Does light behave as a wave instead of a particle? 2. what's the difference between...
1. Does light behave as a wave instead of a particle? 2. what's the difference between the wavelength of red and green lasers 3. Why is white light different from the wavelength of the red and green lasers?
It is common to distinguish between whether an asset acquisition is “capitalized” versus “expensed”. What does...
It is common to distinguish between whether an asset acquisition is “capitalized” versus “expensed”. What does this mean, i.e. what does “capitalized” mean and what does “expensed” mean? From a value perspective, given that value is fundamentally the present value of future cash flows, given the choice, which alternative would be preferred? When an asset is capitalized, this is generally an application of which of the 4 basic principles underlying GAAP? Explain.
Distinguish between the nominal rate and the real rate of interest. How does inflation affect the...
Distinguish between the nominal rate and the real rate of interest. How does inflation affect the real, ex post (after the fact) rate of return to investors?
Why does the UCC distinguish between merchants and nonmerchants by holding merchants to a higher standard...
Why does the UCC distinguish between merchants and nonmerchants by holding merchants to a higher standard in some instances? What does it mean to require parties to act in "good faith" in the performance of a sales contract? Explain and provide an example.
in 200 words or more How does one distinguish between the different types of ratios and...
in 200 words or more How does one distinguish between the different types of ratios and their purposes? Give an example
6. The Altham statistic does not distinguish between occupations with more and less workers. If some...
6. The Altham statistic does not distinguish between occupations with more and less workers. If some occupations are growing and other occupations are shrinking, then why might it be problematic to use the Altham statistic to compare occupational mobility at different points in time?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT