(13) In the three following situations explain which model we should use (a) use
ID: 3888706 • Letter: #
Question
(13) In the three following situations explain which model we should use (a) user-level threading (b) kernel-level threading (c) hybrid-threading (d) no-threading (i.e. single-threaded application) Explain clearly what the advantages are to the choices you have made, or why the other options are not viable. While making your decision consider things like the amount/type of I/O your application requires (a) You are writing an application for an operating system (that support thread- ing). The application needs to continuously and simultaneously fetch infor- mation over a network connection, accept input from the user, and format the display to the user (b) You are writing an application for a single-threaded operating system (i.e. the OS does not support threading). The application waits for a packet of internet information, and then processes the information. The packets come once an hour, and processing takes only a few minutes. (c) You are writing an application to monitor a realtime system (i.e. a manufac- turing floor). The OS supports threads but not 'real-time' threads (the o.s has no way tofuill specific timing requests). The application needs to contin- uously monitor aspects of the real-time system it is monitoring with specific requirements as to the timing. (i.e. every 5 seconds check the heat gauge). If there are N aspects of the real-time system that need to be monitored, each check of that aspect may call a blocking system call.Explanation / Answer
Part a) : USER LEVEL THREADING
Because, we are designing an application which will continiously and simultaneously fetch information over a network i.e. I/O for the application will be the users request only the after processing the input is generated. User-Level threads are managed entirely by the run-time system (user-level library).This can even be implemented in a system which does not supports threading. It makes the threading very fast, i.e. the user will get the response very fast. One more advantage of using this model is that it is 100 times faster than other models & each thread is represented simply by a PC, registers, stack and a small control block, all stored in the user process address space i.e. the user's request will be distinguished and will remains unique.
Part b) : KERNEL - LEVEL THREADING
Because, the application we want to make here have to wait for a packet from the internet and then processes the request. So on overall basis if the packet has not been recieved then the overall OS time will be wasted. So "No-threading" will not work here, since the task of the application is very less i.e. process a single packet per hour, "Hybrid-threading" will also not work here and since the interaction of the OS is needed therefore "User-level threading" also fails, Therefore we will use Kernel-level threading will be used as it can be implemented on a system which don't support threading and the OS time will not be wasted, whenever needed the OS will be able to process the request.
Part c) : HYBRID THREADING
Since this application requires very frequent actions and requests which will considered as Input. And it is a real-time system. i.e. the application will have to process requests in the live world this needs very accurate functioning and fast processing & if anything goes wrong the process will be disrupted and can cost overall damage. In Hybrid threading we use N kernel threads to execute M "tasks”, where M can be much higher than N, which will be resposible for continious monitoring of the aspects of the real-time system we are making.
The advantage of Hybrid threading is that you can take advantage of multiple CPUs or multiple CPU cores. And if one task blocks, you can create another kernel thread to use the available CPU more efficiently. Which will not disrupt the ongoing process flow and will provide fast processing.
Kindly rate if helped. Thankyou.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.