Question
Operating Systems 1. In a system with threads, is there one stack per thread or one stack per process when user-level threads are used? 2.
Operating Systems
1. In a system with threads, is there one stack per thread or one stack per process when user-level threads are used?
2. Many operating systems allocate a static array of PCBs, meaning that there is a fixed, maximum number of processes that can exist in the OS. Provide some arguments for why the kernel does not use a dynamic data structure to allow a variable number of PCBs to exist.
3.In Solaris, user level threads may yield to another thread of the same priority. Isnt it possible that there will be a runnable thread of higher priority and that therefore the yield function should result in yielding to a thread of the same or higher priority?
4.If a process exits and there are still threads of the process running, will they continue to run?
5.In the notes the following two advantages of using multiple threads within a process are that (1) less work is involved in creating a new thread within an existing process than in creating a new process, and (2) communication among threads within the same process is simplified. Is it also the case that a mode switch between two threads within the same process involves less work than a mode switch between two threads in different processes?
6. 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 Exercises 193 terminates, when the program results must be written to a single file. Between startup and termination, the program is entirely CPUbound. 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).
- How many threads will you create to perform the input and output? Explain.
- How many threads will you create for the CPU-intensive portion of the application? Explain.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started